mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-09-30 13:19:01 +02:00
Merge pull request #125 from nedmas/patch-2
FIX: Ensure that ChangeTrackerOptions doesn't get overriden
This commit is contained in:
commit
d21c92a9e3
@ -106,8 +106,27 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('.cms-edit-form').entwine({
|
$('.cms-edit-form').entwine({
|
||||||
|
/**
|
||||||
|
* TODO: Fix with Entwine API extension. See https://github.com/silverstripe/silverstripe-subsites/pull/125
|
||||||
|
*/
|
||||||
getChangeTrackerOptions: function() {
|
getChangeTrackerOptions: function() {
|
||||||
this.ChangeTrackerOptions.ignoreFieldSelector+=', input[name=IsSubsite]';
|
// Figure out if we're still returning the default value
|
||||||
|
var isDefault = (this.entwineData('ChangeTrackerOptions') === undefined);
|
||||||
|
// Get the current options
|
||||||
|
var opts = this._super();
|
||||||
|
|
||||||
|
if (isDefault) {
|
||||||
|
// If it is the default then...
|
||||||
|
// clone the object (so we don't modify the original),
|
||||||
|
var opts = $.extend({}, opts);
|
||||||
|
// modify it,
|
||||||
|
opts.ignoreFieldSelector +=', input[name=IsSubsite]';
|
||||||
|
// then set the clone as the value on this element
|
||||||
|
// (so next call to this method gets this same clone)
|
||||||
|
this.setChangeTrackerOptions(opts);
|
||||||
|
}
|
||||||
|
|
||||||
|
return opts;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user