Sha256: 52696dd12d3733564c2bf3f9e2551f9954914313926725256dabda3cf8c23b1a

Contents?: true

Size: 1.56 KB

Versions: 2

Compression:

Stored size: 1.56 KB

Contents

sc_require("panes/pane");

/**
  Adds SC.Pane specific processes.

  While it would be a little nicer to use didAppendToDocument,
  willRemoveFromDocument and other functions, we cannot because they are public
  callbacks and if a developer overrides them without knowing to call sc_super()
  everything will fail.  Instead, it's better to keep our static setup/remove
  code private.
  */
SC.Pane.reopen({

  /** @private */
  _executeDoAttach: function () {
    // hook into root responder
    var responder = (this.rootResponder = SC.RootResponder.responder);
    responder.panes.add(this);

    // Update the currentWindowSize cache.
    this.set('currentWindowSize', responder.currentWindowSize);

    // Set the initial design mode.  The responder will update this if it changes.
    this.updateDesignMode(this.get('designMode'), responder.get('currentDesignMode'));

    sc_super();

    // Legacy.
    this.paneDidAttach();

    // Legacy?
    this.recomputeDependentProperties();

    // handle intercept if needed
    this._addIntercept();

    // If the layout is flexible (dependent on the window size), then the view
    // will resize when appended.
    if (!this.get('isFixedSize')) {
      // We call viewDidResize so that it calls parentViewDidResize on all child views.
      this.viewDidResize();
    }
  },

  /** @private */
  _executeDoDetach: function () {
    sc_super();

    // remove intercept
    this._removeIntercept();

    // remove the pane
    var rootResponder = this.rootResponder;
    rootResponder.panes.remove(this);
    this.rootResponder = null;
  }

});

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sproutcore-1.11.0 lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane_statechart.js
sproutcore-1.11.0.rc3 lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane_statechart.js