Skip to content

Commit

Permalink
Fix submit behavior when pressing enter and form contains the datepic…
Browse files Browse the repository at this point in the history
…kers
  • Loading branch information
Ioannis Igoumenos committed May 16, 2022
1 parent ff50e79 commit 2eaca37
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
30 changes: 15 additions & 15 deletions app/templates/layout/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<!DOCTYPE html>
<html lang="<?= __('registry.meta.lang'); ?>">
<head>
<?= $this->Html->meta('viewport', 'width=device-width, initial-scale=1.0') . "\n"; ?>
<?= $this->Html->meta('viewport', 'width=device-width, initial-scale=1.0') . PHP_EOL ?>
<?= $this->Html->charset(); ?>

<title><?= (!empty($vv_title) ? $vv_title : __('registry.meta.registry')); ?></title>
Expand All @@ -52,7 +52,7 @@
?> -->

<!-- favicon.ico -->
<?= $this->Html->meta('favicon.ico', '/favicon.ico', array('type' => 'icon')) . "\n"; ?>
<?= $this->Html->meta('favicon.ico', '/favicon.ico', array('type' => 'icon')) . PHP_EOL ?>

<!-- Load CSS -->
<?= $this->Html->css([
Expand All @@ -62,14 +62,14 @@
'co-color',
'co-base',
'co-responsive'
]) . "\n"; ?>
]) . PHP_EOL ?>

<!-- Load Bootstrap and jQuery (other scripts at bottom) -->
<?= $this->Html->script([
'bootstrap/bootstrap.bundle.min.js',
'jquery/jquery.min.js',
'select2/select2.min.js'
]) . "\n"; ?>
]) . PHP_EOL ?>

<!-- Include external files and scripts -->
<?= $this->fetch('meta') ?>
Expand Down Expand Up @@ -104,7 +104,7 @@
<div id="co-hamburger"><em class="material-icons">menu</em></div>
<?php endif; // vv_user ?>
<nav id="top-menu">
<?= $this->element('menuTop'); ?>
<?= $this->element('menuTop') ?>
</nav>
</div>

Expand All @@ -122,7 +122,7 @@
['escape' => false]);
?>
<?php else: ?>
<?= $this->Html->link(__('registry.meta.registry'), '/'); ?>
<?= $this->Html->link(__('registry.meta.registry'), '/') ?>
<?php endif; ?>
<!-- XXX Insert quick CO selector here. -->
</div>
Expand All @@ -146,7 +146,7 @@
<?php if(!empty($vv_user) && !empty($vv_cur_co) && !$isCoSelectView): ?>
<div id="navigation-drawer">
<nav id="navigation" aria-label="main menu">
<?= $this->element('menuMain'); ?>
<?= $this->element('menuMain') ?>
</nav>
</div>
<?php endif ?>
Expand All @@ -158,22 +158,22 @@
<!-- insert breadcrumbs on all but the front page ("Select Collaborations")
and Dashboards (including the CO landing page) -->
<div id="breadcrumbs">
<?= $this->element('breadcrumbs'); ?>
<?= $this->element('breadcrumbs') ?>
</div>
<?php endif; ?>

<!-- insert the anchor that is the target of accessible "skip to content" link -->
<a id="content-start"></a>

<!-- insert the page internal content -->
<?= $this->fetch('content'); ?>
<?= $this->fetch('content') ?>
</div>
</div>
</main>
</div>

<footer id="co-footer">
<?= $this->element('footer'); ?>
<?= $this->element('footer') ?>
</footer>
</div>

Expand All @@ -190,10 +190,10 @@ class="toast-container"
</div>

<!-- modal dialog box -->
<?= $this->element('dialog'); ?>
<?= $this->element('dialog') ?>

<!-- Get timezone detection -->
<?= $this->Html->script('jstimezonedetect/jstz.min.js'); ?>
<?= $this->Html->script('jstimezonedetect/jstz.min.js') ?>
<script>
// Determines the time zone of the browser client
var tz = jstz.determine();
Expand All @@ -208,11 +208,11 @@ class="toast-container"
'vue/vue-3.2.31.global.prod.js',
'js-cookie/js.cookie-2.1.3.min.js',
'comanage/comanage.js'
]) . "\n"; ?>
]) . PHP_EOL ?>

<!-- Duet Datepicker should be loaded as a module -->
<?= $this->Html->script('duet-datepicker/duet/duet.esm.js',['type' => 'module']); ?>
<?= $this->Html->script('duet-datepicker/duet/duet.js',['nomodule' => '']); ?>
<?= $this->Html->script('duet-datepicker/duet/duet.esm.js',['type' => 'module']) ?>
<?= $this->Html->script('duet-datepicker/duet/duet.js',['nomodule' => '']) ?>

<!-- COmanage JavaScript onload scripts -->
<?php print $this->element('javascript'); ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export default {
ref="curDuetPicker">
</duet-date-picker>
<div v-if="this.timed" class="cm-time-picker">
<button @click.stop.prevent="showTimePicker" class="btn">
<button @click.stop.prevent="showTimePicker" type="button" class="btn">
<em class="material-icons">schedule</em>
</button>
<Transition>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default {
<div class="cm-time-picker-vals">
<ul>
<li v-for="n in 24">
<button @click.stop.prevent="setTime($event,'hour')" class="btn">{{ ('0' + (n-1)).slice(-2) }}</button>
<button @click.stop.prevent="setTime($event,'hour')" type="button" class="btn">{{ ('0' + (n-1)).slice(-2) }}</button>
</li>
</ul>
</div>
Expand All @@ -61,7 +61,7 @@ export default {
<div class="cm-time-picker-vals">
<ul>
<li v-for="val of minuteVals">
<button @click.stop.prevent="setTime($event,'minute')" class="btn">{{ val }}</button>
<button @click.stop.prevent="setTime($event,'minute')" type="button" class="btn">{{ val }}</button>
</li>
</ul>
</div>
Expand Down

0 comments on commit 2eaca37

Please sign in to comment.