diff --git a/core/modules/edit/js/edit.js b/core/modules/edit/js/edit.js index 1d618a6..1f0cfdb 100644 --- a/core/modules/edit/js/edit.js +++ b/core/modules/edit/js/edit.js @@ -22,8 +22,7 @@ var options = $.extend({ strings: { - quickEdit: Drupal.t('Quick edit'), - stopQuickEdit: Drupal.t('Stop quick edit') + quickEdit: Drupal.t('Quick edit') } }, drupalSettings.edit); diff --git a/core/modules/edit/js/util.js b/core/modules/edit/js/util.js index e8c84bc..dd8bd66 100644 --- a/core/modules/edit/js/util.js +++ b/core/modules/edit/js/util.js @@ -61,7 +61,10 @@ Drupal.edit.util.form = { Drupal.ajax[fieldID] = new Drupal.ajax(fieldID, $el, { url: Drupal.edit.util.buildUrl(fieldID, drupalSettings.edit.fieldFormURL), event: 'edit-internal.edit', - submit: { nocssjs : options.nocssjs, reset : options.reset }, + submit: { + nocssjs: options.nocssjs, + reset: options.reset + }, progress: { type : null } // No progress indicator. }); // Implement a scoped editFieldForm AJAX command: calls the callback. diff --git a/core/modules/edit/js/views/ContextualLinkView.js b/core/modules/edit/js/views/ContextualLinkView.js index 4b4d075..3730756 100644 --- a/core/modules/edit/js/views/ContextualLinkView.js +++ b/core/modules/edit/js/views/ContextualLinkView.js @@ -33,36 +33,22 @@ Drupal.edit.ContextualLinkView = Backbone.View.extend({ * - strings: the strings for the "Quick edit" link */ initialize: function (options) { + // Insert the text of the quick edit toggle. + this.$el.find('a').text(this.options.strings.quickEdit); // Initial render. this.render(); - // Re-render whenever this entity's isActive attribute changes. this.model.on('change:isActive', this.render, this); - - // Hide the contextual links whenever an in-place editor is active. - this.options.appModel.on('change:activeEditor', this.toggleContextualLinksVisibility, this); }, /** * {@inheritdoc} */ - render: function () { - var strings = this.options.strings; - var text = !this.model.get('isActive') ? strings.quickEdit : strings.stopQuickEdit; - this.$el.find('a').text(text); - return this; - }, + render: function (entityModel, isActive) { + // Hides the contextual links if an in-place editor is active. + this.$el.parents('.contextual').toggle(!isActive); - /** - * Hides the contextual links if an in-place editor is active. - * - * @param Drupal.edit.AppModel appModel - * The application state model. - * @param null|Drupal.edit.FieldModel activeEditor - * The model of the field that is currently being edited, or, if none, null. - */ - toggleContextualLinksVisibility: function (appModel, activeEditor) { - this.$el.parents('.contextual').toggle(activeEditor === null); + return this; } }); diff --git a/core/modules/editor/js/editor.js b/core/modules/editor/js/editor.js index f07aa73..9bbce1d 100644 --- a/core/modules/editor/js/editor.js +++ b/core/modules/editor/js/editor.js @@ -83,12 +83,9 @@ Drupal.behaviors.editor = { var $this = $(this); var activeFormatID = $this.val(); var field = behavior.findFieldForFormatSelector($this); - if ('activeFormatID' in settings.editor.formats) { + if (activeFormatID in settings.editor.formats) { Drupal.editorDetach(field, settings.editor.formats[activeFormatID], trigger); } - else { - console.log('%c editor.js: The format ' + activeFormatID + ' does not have an editor.', 'background-color: red; color: white;'); - } }); },