Commit 7981731f authored by Henrik Danielsson's avatar Henrik Danielsson
Browse files

By TwoD: Fixed undefined variable '$field' for Whizzywig.

parent 71c15fc6
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -142,12 +142,13 @@ Drupal.wysiwyg.editor.instance.whizzywig = {
  },

  getContent: function () {
    var $field = $('#' + this.field);
    // Whizzywig's tidyH() expects a document node. Clone the editing iframe's
    // document so tidyH() won't mess with it if this gets called while editing.
    var clone = $($('#whizzy' + this.field).contents()[0].documentElement).clone()[0].ownerDocument;
    // Whizzywig shows the original textarea in source mode so update the body.
    if ($field.css('display') == 'block') {
     clone.body.innerHTML = $('#' + this.field).val();
     clone.body.innerHTML = $field.val();
    }
    return tidyH(clone);
  }
+2 −1
Original line number Diff line number Diff line
@@ -94,12 +94,13 @@ Drupal.wysiwyg.editor.instance.whizzywig = {
  },

  getContent: function () {
    var $field = $('#' + this.field);
    // Whizzywig's tidyH() expects a document node. Clone the editing iframe's
    // document so tidyH() won't mess with it if this gets called while editing.
    var clone = $($('#whizzy' + this.field).contents()[0].documentElement).clone()[0].ownerDocument;
    // Whizzywig shows the original textarea in source mode so update the body.
    if ($field.css('display') == 'block') {
     clone.body.innerHTML = $('#' + this.field).val();
     clone.body.innerHTML = $field.val();
    }
    return tidyH(clone);
  }