diff --git a/code/LeftAndMain.php b/code/LeftAndMain.php index 46f88545..9db36166 100644 --- a/code/LeftAndMain.php +++ b/code/LeftAndMain.php @@ -182,6 +182,7 @@ class LeftAndMain extends Controller { Requirements::javascript(THIRDPARTY_DIR . '/hover.js'); Requirements::javascript(THIRDPARTY_DIR . '/layout_helpers.js'); Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang'); + Requirements::add_i18n_javascript(CMS_DIR . '/javascript/lang'); Requirements::javascript(THIRDPARTY_DIR . '/scriptaculous/effects.js'); Requirements::javascript(THIRDPARTY_DIR . '/scriptaculous/dragdrop.js'); diff --git a/javascript/LeftAndMain.js b/javascript/LeftAndMain.js index 9fcfed11..71a79de0 100644 --- a/javascript/LeftAndMain.js +++ b/javascript/LeftAndMain.js @@ -584,7 +584,9 @@ ChangeTracker.prototype = { }, field_changed: function() { - return this.originalSerialized != Form.Element.serialize(this); + // Something a value will go from 'undefined' to ''. Ignore such changes + if((this.originalSerialized+'') == 'undefined') return Form.Element.serialize(this) ? true : false; + else return this.originalSerialized != Form.Element.serialize(this); }, /** @@ -600,8 +602,8 @@ ChangeTracker.prototype = { if(!element.isChanged) element.isChanged = this.field_changed; if(!this.changeDetection_fieldsToIgnore[element.name] && element.isChanged()) { - //if( window.location.href.match( /^https?:\/\/dev/ ) ) - // Debug.log('Changed:'+ element.id + '(' + this.originalSerialized +')->('+Form.Element.serialize(element)+')' ); + //console.log('Changed:'+ element.id + '(' + this.originalSerialized +')->('+Form.Element.serialize(element)+')' ); + //console.log(element) return true; }