From c19f95ded8c9b2e7d1e9cf1f2b95976a3dca7cb0 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 19 Sep 2013 20:37:17 +0000 Subject: [PATCH] For multiselectboxes, we need to do an array comparison for dirty, or it will always fail (be dirty) --- etemplate/js/et2_widget_selectbox.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/etemplate/js/et2_widget_selectbox.js b/etemplate/js/et2_widget_selectbox.js index a36b3cbd83..ea22de1d9d 100644 --- a/etemplate/js/et2_widget_selectbox.js +++ b/etemplate/js/et2_widget_selectbox.js @@ -670,6 +670,19 @@ var et2_selectbox = et2_inputWidget.extend( this.value = this._super.apply(this, arguments); } return this.value; + }, + + isDirty: function() { + if(this.input == null) + { + var value = this.getValue(); + // Array comparison + return !($j(this._oldValue).not(value).length == 0 && $j(value).not(this._oldValue).length == 0); + } + else + { + return this._super.apply(this, arguments); + } } }); et2_register_widget(et2_selectbox, ["menupopup", "listbox", "select", "select-cat",