5620: added comment to input trigger event
authorRadhika Chippada <radhika@curoverse.com>
Mon, 20 Apr 2015 15:42:04 +0000 (11:42 -0400)
committerRadhika Chippada <radhika@curoverse.com>
Mon, 20 Apr 2015 15:42:04 +0000 (11:42 -0400)
apps/workbench/app/assets/javascripts/application.js
apps/workbench/app/helpers/application_helper.rb

index 3183fb72b370ab1f70d6e45182c8d7a9059c07f0..65e856df3a90143a5955def3698acc89784ff438 100644 (file)
@@ -147,6 +147,9 @@ jQuery(function($){
             $('.modal').attr('tabindex', '-1')
         }).
         on('ready', function() {
+            // Need this to trigger input validation/synchronization callbacks because some browsers
+            // auto-fill form fields (e.g., when navigating "back" to a page where some text
+            // had been entered in a search box) without triggering a change or input event.
             $('input').trigger('input');
         });
 
index 1755e7933c8e34e3277b44038ba1bb042e71f1a9..d1655b92843ddf270c488c1677f8ef54f2d938db 100644 (file)
@@ -364,7 +364,7 @@ module ApplicationHelper
            success: 'page-refresh'
          }.to_json,
         })
-      is_readable_input = object_readable attrvalue, Collection unless attrvalue.andand.empty?
+      is_readable_input = attrvalue.present? and object_readable attrvalue, Collection
       return content_tag('div', :class => 'input-group') do
         html = text_field_tag(dn, display_value,
                               :class =>