app/assets/javascripts/contour/global.js.coffee in contour-1.1.3 vs app/assets/javascripts/contour/global.js.coffee in contour-1.2.0.pre
- old
+ new
@@ -1,10 +1,10 @@
# Global functions referenced from HTML
@showWaiting = (element_id, text, centered) ->
element = $(element_id)
if element && centered
- element.html('<br /><div class=\"center\"><img width=\"13\" height=\"13\" src=\"' + root_url + 'assets/contour/ajax-loader.gif\" align=\"absmiddle\" alt=\"...\" />' + text + '</div><br />')
+ element.html('<br /><center><img width=\"13\" height=\"13\" src=\"' + root_url + 'assets/contour/ajax-loader.gif\" align=\"absmiddle\" alt=\"...\" />' + text + '</center><br />')
else if element
element.html('<img width=\"13\" height=\"13\" src=\"' + root_url + 'assets/contour/ajax-loader.gif\" align=\"absmiddle\" alt=\"...\" />' + text)
@flashMessage = (message, alert_type = 'success', overwrite = true) ->
div_block = "<div class='alert alert-#{alert_type}'><button type='button' class='close' data-dismiss='alert'>×</button>#{message}</div>"
@@ -16,16 +16,22 @@
@nonStandardClick = (event) ->
event.which > 1 or event.metaKey or event.ctrlKey or event.shiftKey or event.altKey
jQuery ->
- $(".datepicker").datepicker
- showOtherMonths: true
- selectOtherMonths: true
- changeMonth: true
- changeYear: true
+ $(".timepicker").timepicker
+ showMeridian: false
+ showSeconds: true
+ defaultTime: false
+ $(".datepicker").datepicker('remove')
+ $(".datepicker").datepicker( autoclose: true )
- $("#ui-datepicker-div").hide()
+ $(document).on('change', '.datepicker', () ->
+ try
+ $(this).val($.datepicker.formatDate('mm/dd/yy', $.datepicker.parseDate('mm/dd/yy', $(this).val())))
+ catch error
+ # Nothing
+ )
$(document).on('click', ".pagination a, .page a, .next a, .prev a", () ->
return false if $(this).parent().is('.active, .disabled, .per_page')
$.get(this.href, null, null, "script")
false