editor: Save button, divider defaults by its context of usage

This commit is contained in:
Rostislav Wolny
2018-03-12 15:22:50 +01:00
parent 8582c19ac0
commit fbfcfcc85b
4 changed files with 22 additions and 1 deletions

View File

@@ -41,7 +41,8 @@ define([
return JSON.parse(JSON.stringify(jQuery.extend(blockDefaults, defaults || {})));
},
_updateDefaults: function updateDefaults() {
App.getConfig().set('blockDefaults.' + this.get('type'), this.toJSON());
var context = this.get('context') || this.get('type');
App.getConfig().set('blockDefaults.' + context, this.toJSON());
},
toJSON: function toJSON() {
// Remove stale attributes from resulting JSON object