Skip to content

Commit

Permalink
Merge branch 'master' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
mrzapp committed Nov 2, 2017
2 parents 5ab8a46 + caddd3d commit 2462d94
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 25 deletions.
16 changes: 4 additions & 12 deletions public/js/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -43737,15 +43737,6 @@ var ContentPane = function (_NavbarPane) {
};
}

menu['Folder'] = '---';

menu['New content'] = function () {
var targetId = $('.context-menu-target').data('id');
var parentId = ContentHelper.getContentByIdSync(targetId).parentId;

_this2.onClickNewContent(parentId);
};

if (!item.sync.isRemote && !item.isLocked) {
menu['Settings'] = '---';
menu['Publishing'] = function () {
Expand Down Expand Up @@ -47508,10 +47499,11 @@ var StructEditor = function (_FieldEditor) {
* @param {Object} newValue
* @param {String} key
* @param {Object} keySchema
* @param {Boolean} isSilent
*/


StructEditor.prototype.onChange = function onChange(newValue, key, keySchema) {
StructEditor.prototype.onChange = function onChange(newValue, key, keySchema, isSilent) {
if (keySchema.multilingual) {
// Sanity check to make sure multilingual fields are accomodated for
if (!this.value[key] || _typeof(this.value[key]) !== 'object') {
Expand All @@ -47524,7 +47516,7 @@ var StructEditor = function (_FieldEditor) {
this.value[key] = newValue;
}

this.trigger('change', this.value);
this.trigger(isSilent ? 'silentchange' : 'change', this.value);
};

/**
Expand Down Expand Up @@ -47706,7 +47698,7 @@ var StructEditor = function (_FieldEditor) {
});

fieldEditorInstance.on('silentchange', function (newValue) {
_this2.onChange(newValue, k, keySchema);
_this2.onChange(newValue, k, keySchema, true);
});

// Return the DOM element
Expand Down
7 changes: 4 additions & 3 deletions src/Client/Views/Editors/FieldEditors/StructEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ class StructEditor extends FieldEditor {
* @param {Object} newValue
* @param {String} key
* @param {Object} keySchema
* @param {Boolean} isSilent
*/
onChange(newValue, key, keySchema) {
onChange(newValue, key, keySchema, isSilent) {
if(keySchema.multilingual) {
// Sanity check to make sure multilingual fields are accomodated for
if(!this.value[key] || typeof this.value[key] !== 'object') {
Expand All @@ -69,7 +70,7 @@ class StructEditor extends FieldEditor {
this.value[key] = newValue;
}

this.trigger('change', this.value);
this.trigger(isSilent ? 'silentchange' : 'change', this.value);
}

/**
Expand Down Expand Up @@ -293,7 +294,7 @@ class StructEditor extends FieldEditor {
});

fieldEditorInstance.on('silentchange', (newValue) => {
this.onChange(newValue, k, keySchema);
this.onChange(newValue, k, keySchema, true);
});

// Return the DOM element
Expand Down
11 changes: 1 addition & 10 deletions src/Client/Views/Navigation/ContentPane.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,15 +379,6 @@ class ContentPane extends NavbarPane {
menu['Remove'] = () => { this.onClickRemoveContent(true); };
}

menu['Folder'] = '---';

menu['New content'] = () => {
let targetId = $('.context-menu-target').data('id');
let parentId = ContentHelper.getContentByIdSync(targetId).parentId;

this.onClickNewContent(parentId);
};

if(!item.sync.isRemote && !item.isLocked) {
menu['Settings'] = '---';
menu['Publishing'] = () => { this.onClickContentPublishing(); };
Expand All @@ -412,7 +403,7 @@ class ContentPane extends NavbarPane {
}

menu['General'] = '---';
menu['New content'] = () => { this.onClickNewContent(); };
menu['New content'] = () => { this.onClickNewContent(); };
menu['Refresh'] = () => { this.onClickRefreshResource('content'); };

return menu;
Expand Down

0 comments on commit 2462d94

Please sign in to comment.