Issue #2149933 by effulgentsia: Improve Edit module JS to use .find(...) instead of .is(':has(...)').

8.0.x
webchick 2013-12-10 23:03:17 -08:00
parent 954790465d
commit af335ce5c7
1 changed files with 3 additions and 2 deletions

View File

@ -23,8 +23,9 @@ Drupal.edit.editors.plain_text = Drupal.edit.EditorView.extend({
// Store the original value of this field. Necessary for reverting changes.
var $textElement;
if (this.$el.is(':has(.field-item)')) {
$textElement = this.$textElement = this.$el.find('.field-item:first');
var $fieldItems = this.$el.find('.field-item');
if ($fieldItems.length) {
$textElement = this.$textElement = $fieldItems.eq(0);
}
else {
$textElement = this.$textElement = this.$el;