Skip to content

Commit

Permalink
Only use webshim for userload rerun form
Browse files Browse the repository at this point in the history
  • Loading branch information
jgreben committed Jan 6, 2017
1 parent 805719f commit 0469741
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
13 changes: 2 additions & 11 deletions app/assets/javascripts/html5_webshim.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$(document).on('ready page:load', function() {
if (window.webshim) {
if (window.webshim && $('[data-behavior="rerun-date-picker"]').length > 0) {
var webShimOptions = {
lazyCustomMessages: true,
replaceUI: true,
Expand All @@ -13,17 +13,8 @@ $(document).on('ready page:load', function() {
}
};

if ($('[data-behavior="rerun-date-picker"]').length === 0) {
webShimOptions.date.popover = {
position: {
my: 'center bottom',
at: 'center top',
collision: 'none'
}
};
}

window.webshim.setOptions('forms-ext', webShimOptions);
window.webshim.polyfill('forms-ext');
window.webshim.activeLang('en');
}
});
4 changes: 2 additions & 2 deletions app/views/sal3_batch_requests_batches/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@
<div class='form-group row'>
<%= f.label :batch_startdate, "Delivery start date:", class: 'col-sm-2 form-control-label' %>
<div class='col-sm-10'>
<%= f.date_field 'batch_startdate', id: 'dp1', class: 'form-control', value: "#{DateTime.now.strftime('%d-%^b-%y')}" %>
<%= f.date_field 'batch_startdate', id: 'dp1', class: 'form-control' %>
</div>
</div>
<div class='form-group row'>
<%= f.label :batch_needbydate, "All items delivered by:", class: 'col-sm-2 form-control-label' %>
<div class='col-sm-10'>
<%= f.date_field 'batch_needbydate', id: 'dp2', class: 'form-control', value: "#{DateTime.now.strftime('%d-%^b-%y')}" %>
<%= f.date_field 'batch_needbydate', id: 'dp2', class: 'form-control' %>
</div>
</div>
<div class='indent'>
Expand Down

0 comments on commit 0469741

Please sign in to comment.