Skip to content

Commit

Permalink
[Zurich] Upgrade jQuery UI, use minimal required.
Browse files Browse the repository at this point in the history
Remove use of jQuery UI spinner entirely, and cut down the included
jQuery UI CSS/JS to only the used autocomplete library.
  • Loading branch information
dracos committed May 21, 2021
1 parent d269fcf commit ba6788c
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion templates/web/zurich/admin/report_edit-sdm.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@

<p class="screen-only">
<label for="time_spent">[% loc('Time spent (in minutes):') %]</label>
<input [% sdm_disabled %] type="text" class="form-control" name="time_spent" id="form_time_spent" style="width: 4em" value="0">
<input [% sdm_disabled %] type="number" class="form-control" name="time_spent" id="form_time_spent" style="width: 4em" value="0" min="0">
</p>

<p class="clearfix screen-only">
Expand Down
2 changes: 1 addition & 1 deletion templates/web/zurich/admin/reports/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
<label for="time_spent">[% loc('Time spent (in minutes):') %]</label>
</dt>
<dd class="screen-only">
<input type="text" class="form-control" name="time_spent" id="form_time_spent" style="width: 4em" value="0">
<input type="number" class="form-control" name="time_spent" id="form_time_spent" style="width: 4em" value="0" min="0">
</dd>

<dt class="screen-only">
Expand Down
2 changes: 1 addition & 1 deletion templates/web/zurich/footer_extra_js.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[% scripts.push(
version('/vendor/jquery-2.2.4.min.js'),
version('/cobrands/zurich/validation_rules.js'),
'//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js',
version('/vendor/jquery-ui.min.js'),
version('/cobrands/zurich/js.js'),
) %]
2 changes: 1 addition & 1 deletion templates/web/zurich/header_extra.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/themes/redmond/jquery-ui.css">
<link rel="stylesheet" href="[% version('/vendor/jquery-ui.min.css') %]">
[% INCLUDE 'tracking_code.html' %]
7 changes: 0 additions & 7 deletions web/cobrands/zurich/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,6 @@ table#admin_bodies tr.is-deleted {
background-color: transparent;
}

.ui-spinner input {
// stop jQuery UI spinner inputs from inheriting FMS input styles
padding: 1px;
border: none;
border-radius: 0;
}

.square-map__outer {
width: 100%;
height: 0;
Expand Down
7 changes: 0 additions & 7 deletions web/cobrands/zurich/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@ $(function() {

var form_fields_changed = false;

$('#form_time_spent').spinner({
spin: function (e, ui) {
if (ui.value < 0) { return false; }
form_fields_changed = true;
}
});

setTimeout(function(){
$('.message-updated').fadeOut(250, function(){
$(this).remove();
Expand Down
7 changes: 7 additions & 0 deletions web/vendor/jquery-ui.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions web/vendor/jquery-ui.min.js

Large diffs are not rendered by default.

0 comments on commit ba6788c

Please sign in to comment.