core/modules/edit/css/edit.css | 1 + core/modules/edit/js/backbone.drupalform.js | 8 ++++--- .../edit/js/createjs/editingWidgets/formwidget.js | 5 ++-- .../edit/js/views/propertyeditordecoration-view.js | 24 -------------------- core/modules/edit/js/views/toolbar-view.js | 4 ++-- 5 files changed, 11 insertions(+), 31 deletions(-) diff --git a/core/modules/edit/css/edit.css b/core/modules/edit/css/edit.css index 7b758b7..6a5ac83 100644 --- a/core/modules/edit/css/edit.css +++ b/core/modules/edit/css/edit.css @@ -188,6 +188,7 @@ z-index: 300; box-shadow: 0 0 30px 4px #4f4f4f; max-width: 35em; + background-color: white; } .edit-form .placeholder { diff --git a/core/modules/edit/js/backbone.drupalform.js b/core/modules/edit/js/backbone.drupalform.js index ba79e76..859b8a6 100644 --- a/core/modules/edit/js/backbone.drupalform.js +++ b/core/modules/edit/js/backbone.drupalform.js @@ -89,11 +89,13 @@ Backbone.syncDrupalFormWidget = function(method, model, options) { Backbone.syncDirect = function(method, model, options) { if (method === 'update') { var fillAndSubmitForm = function(value) { - jQuery('#edit_backstage form') + var $form = jQuery('#edit_backstage form'); // Fill in the value in any that isn't hidden or a submit button. - .find(':input[type!="hidden"][type!="submit"]:not(select)').val(value).end() + $form.find(':input[type!="hidden"][type!="submit"]:not(select)') + // Don't mess with the node summary. + .not('[name$="\[summary\]"]').val(value); // Submit the form. - .find('.edit-form-submit').trigger('click.edit'); + $form.find('.edit-form-submit').trigger('click.edit'); }; var entity = options.editor.options.entity; var predicate = options.editor.options.property; diff --git a/core/modules/edit/js/createjs/editingWidgets/formwidget.js b/core/modules/edit/js/createjs/editingWidgets/formwidget.js index 83dad4f..2e9bef4 100644 --- a/core/modules/edit/js/createjs/editingWidgets/formwidget.js +++ b/core/modules/edit/js/createjs/editingWidgets/formwidget.js @@ -79,8 +79,7 @@ this.$formContainer .find('.edit-form') .addClass('edit-editable edit-highlighted edit-editing') - .attr('role', 'dialog') - .css('background-color', $editorElement.css('background-color')); + .attr('role', 'dialog'); // Insert form container in DOM. if ($editorElement.css('display') === 'inline') { @@ -138,6 +137,8 @@ } Drupal.edit.util.form.unajaxifySaving(this.$formContainer.find('.edit-form-submit')); + // Allow form widgets to detach properly. + Drupal.detachBehaviors(this.$formContainer, null, 'unload'); this.$formContainer .off('change.edit', ':input') .off('keypress.edit', 'input') diff --git a/core/modules/edit/js/views/propertyeditordecoration-view.js b/core/modules/edit/js/views/propertyeditordecoration-view.js index aad9832..b512322 100644 --- a/core/modules/edit/js/views/propertyeditordecoration-view.js +++ b/core/modules/edit/js/views/propertyeditordecoration-view.js @@ -41,8 +41,6 @@ Drupal.edit.views.PropertyEditorDecorationView = Backbone.View.extend({ this.predicate = this.editor.options.property; - this.$el.css('background-color', this._getBgColor(this.$el)); - // Only start listening to events as soon as we're no longer in the 'inactive' state. this.undelegateEvents(); }, @@ -260,28 +258,6 @@ Drupal.edit.views.PropertyEditorDecorationView = Backbone.View.extend({ }, /** - * Gets the background color of an element (or the inherited one). - * - * @param $e - * A DOM element. - */ - _getBgColor: function($e) { - var c; - - if ($e === null || $e[0].nodeName === 'HTML') { - // Fallback to white. - return 'rgb(255, 255, 255)'; - } - c = $e.css('background-color'); - // TRICKY: edge case for Firefox' "transparent" here; this is a - // browser bug: https://bugzilla.mozilla.org/show_bug.cgi?id=635724 - if (c === 'rgba(0, 0, 0, 0)' || c === 'transparent') { - return this._getBgColor($e.parent()); - } - return c; - }, - - /** * Gets the top and left properties of an element and convert extraneous * values and information into numbers ready for subtraction. * diff --git a/core/modules/edit/js/views/toolbar-view.js b/core/modules/edit/js/views/toolbar-view.js index b052362..3cf6eca 100644 --- a/core/modules/edit/js/views/toolbar-view.js +++ b/core/modules/edit/js/views/toolbar-view.js @@ -29,7 +29,7 @@ Drupal.edit.views.ToolbarView = Backbone.View.extend({ 'click.edit button.label': 'onClickInfoLabel', 'mouseleave.edit': 'onMouseLeave', 'click.edit button.field-save': 'onClickSave', - 'click.edit button.field-close': 'onClickClose', + 'click.edit button.field-close': 'onClickClose' }, /** @@ -394,7 +394,7 @@ Drupal.edit.views.ToolbarView = Backbone.View.extend({ }))); // Insert in DOM. - if (this.$el.css('display') === 'inline') { + if (this.editor.element.css('display') === 'inline') { this.$el.prependTo(this.editor.element.offsetParent()); var pos = this.editor.element.position(); this.$el.css('left', pos.left).css('top', pos.top);