BUGFIX #3715: Removed spurious change detection in files and images section

BUGFIX: #3715: Show the changes message in a popup instead of a blank confirm box

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@73084 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-03-16 02:59:52 +00:00
parent e1ce3dff46
commit f18ace08b7
2 changed files with 6 additions and 3 deletions

View File

@ -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');

View File

@ -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;
}