function _observe() {
      var interval,
          that = this,
          form = this.textarea.element.form,
          startInterval = function startInterval() {
        interval = setInterval(function () {
          that.fromComposerToTextarea();
        }, INTERVAL);
      },
          stopInterval = function stopInterval() {
        clearInterval(interval);
        interval = null;
      };

      startInterval();

      if (form) {
        // If the textarea is in a form make sure that after onreset and onsubmit the composer
        // has the correct state
        wysihtml5.dom.observe(form, "submit", function () {
          that.sync(true);
        });
        wysihtml5.dom.observe(form, "reset", function () {
          setTimeout(function () {
            that.fromTextareaToComposer();
          }, 0);
        });
      }

      this.editor.observe("change_view", function (view) {
        if (view === "composer" && !interval) {
          that.fromTextareaToComposer(true);
          startInterval();
        } else if (view === "textarea") {
          that.fromComposerToTextarea(true);
          stopInterval();
        }
      });

      this.editor.observe("destroy:composer", stopInterval);
    }
/**
     * Initializes interval-based syncing
     * also makes sure that on-submit the composer's content is synced with the textarea
     * immediately when the form gets submitted
     */
Initializes interval-based syncing
also makes sure that on-submit the composer's content is synced with the textarea
immediately when the form gets submitted
Initializes interval - based syncing also makes sure that on - submit the composer ' s content is synced with the textarea immediately when the form gets submitted
function _observe() {
      var interval,
          that = this,
          form = this.textarea.element.form,
          startInterval = function startInterval() {
        interval = setInterval(function () {
          that.fromComposerToTextarea();
        }, INTERVAL);
      },
          stopInterval = function stopInterval() {
        clearInterval(interval);
        interval = null;
      };
      startInterval();
      if (form) {
        wysihtml5.dom.observe(form, "submit", function () {
          that.sync(true);
        });
        wysihtml5.dom.observe(form, "reset", function () {
          setTimeout(function () {
            that.fromTextareaToComposer();
          }, 0);
        });
      }
      this.editor.observe("change_view", function (view) {
        if (view === "composer" && !interval) {
          that.fromTextareaToComposer(true);
          startInterval();
        } else if (view === "textarea") {
          that.fromComposerToTextarea(true);
          stopInterval();
        }
      });
      this.editor.observe("destroy:composer", stopInterval);
    }
function _observe ( ) { var interval , that = this , form = this . textarea . element . form , startInterval = function startInterval ( ) { interval = setInterval ( function ( ) { that . fromComposerToTextarea ( ) ; } , INTERVAL ) ; } , stopInterval = function stopInterval ( ) { clearInterval ( interval ) ; interval = null ; } ; startInterval ( ) ; if ( form ) { wysihtml5 . dom . observe ( form , "submit" , function ( ) { that . sync ( true ) ; } ) ; wysihtml5 . dom . observe ( form , "reset" , function ( ) { setTimeout ( function ( ) { that . fromTextareaToComposer ( ) ; } , 0 ) ; } ) ; } this . editor . observe ( "change_view" , function ( view ) { if ( view === "composer" && ! interval ) { that . fromTextareaToComposer ( true ) ; startInterval ( ) ; } else if ( view === "textarea" ) { that . fromComposerToTextarea ( true ) ; stopInterval ( ) ; } } ) ; this . editor . observe ( "destroy:composer" , stopInterval ) ; }
Initializes interval-based syncing
 also makes sure that on-submit the composer's content is synced with the textarea
 immediately when the form gets submitted
Initializes interval - based syncing also makes sure that on - submit the composer ' s content is synced with the textarea immediately when the form gets submitted
// If the textarea is in a form make sure that after onreset and onsubmit the composer // has the correct state