Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / quickedit / js / editors / plainTextEditor.es6.js
index bb4bb3c2bc0b54cc8edf03e578b48cd53b69438a..92e5a5dd0f9bb9795d22895412b11c354cba13f4 100644 (file)
 
       // Store the original value of this field. Necessary for reverting
       // changes.
-      let $textElement;
       const $fieldItems = this.$el.find('.quickedit-field');
-      if ($fieldItems.length) {
-        $textElement = this.$textElement = $fieldItems.eq(0);
-      }
-      else {
-        $textElement = this.$textElement = this.$el;
-      }
+      const $textElement = $fieldItems.length ? $fieldItems.eq(0) : this.$el;
+      this.$textElement = $textElement;
       editorModel.set('originalValue', $.trim(this.$textElement.text()));
 
       // Sets the state to 'changed' whenever the value changes.