CRM-14353 - More accurate comparison with multiselects and excluding buttons
authorColeman Watts <coleman@civicrm.org>
Mon, 9 Jun 2014 15:58:57 +0000 (16:58 +0100)
committerColeman Watts <coleman@civicrm.org>
Mon, 9 Jun 2014 15:58:57 +0000 (16:58 +0100)
js/Common.js

index 44736662ea810a7df749fe9968da42f3e85c00f7..7918a9596d59a105df51adb4dc021094add8c1d5 100644 (file)
@@ -245,10 +245,10 @@ CRM.validate = CRM.validate || {
  */
   CRM.utils.initialValueChanged = function(el) {
     var isDirty = false;
-    $(':input:visible, :input.select2-offscreen', el).each(function () {
+    $(':input:visible, :input.select2-offscreen', el).not('[type=submit], [type=button], .crm-action-menu').each(function () {
       var initialValue = $(this).data('crm-initial-value');
       // skip change of value for submit buttons
-      if (initialValue !== undefined && !$(this).hasClass('form-submit') && initialValue != $(this).val()) {
+      if (initialValue !== undefined && !_.isEqual(initialValue, $(this).val())) {
         isDirty = true;
       }
     });