Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added getSize() to FlexibleLayout #77

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion FlexibleLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ define(function(require, exports, module) {

this._ratios = new Transitionable(this.options.ratios);
this._nodes = [];

this._size = [undefined,undefined]; // for getSize;

this._cachedDirection = null;
this._cachedTotalLength = false;
Expand Down Expand Up @@ -148,6 +150,16 @@ define(function(require, exports, module) {
this._ratiosDirty = true;
};


/**
* Get size
*
* @method getSize
*/
FlexibleLayout.prototype.getSize = function getSize() {
return this._size;
};

/**
* Apply changes from this component to the corresponding document element.
* This includes changes to classes, styles, size, content, opacity, origin,
Expand All @@ -158,7 +170,7 @@ define(function(require, exports, module) {
* @param {Context} context commit context
*/
FlexibleLayout.prototype.commit = function commit(context) {
var parentSize = context.size;
var parentSize = this._size = context.size;
var parentTransform = context.transform;
var parentOrigin = context.origin;

Expand Down