app/assets/javascripts/active_admin/pages/application.js.coffee in activeadmin-0.5.1 vs app/assets/javascripts/active_admin/pages/application.js.coffee in activeadmin-0.6.0
- old
+ new
@@ -1,13 +1,16 @@
-#
-# Active Admin JS
-#
+# Initializers
+$ ->
+ # jQuery datepickers (also evaluates dynamically added HTML)
+ $(document).on 'focus', '.datepicker:not(.hasDatepicker)', ->
+ $(@).datepicker dateFormat: 'yy-mm-dd'
+ # Clear Filters button
+ $('.clear_filters_btn').click ->
+ window.location.search = ''
-$ ->
- # Date picker
- $(".datepicker").datepicker dateFormat: "yy-mm-dd"
- $(".clear_filters_btn").click ->
- window.location.search = ""
- false
+ # Batch Actions dropdown
+ $('.dropdown_button').popover()
- $(".dropdown_button").popover()
+ # Filter form: don't send any inputs that are empty
+ $('#q_search').submit ->
+ $(@).find(':input').filter(-> @value is '').prop 'disabled', true