Skip to content

Commit

Permalink
Add support for explicit toggle widths in Splitview's toggle method.
Browse files Browse the repository at this point in the history
  • Loading branch information
anutron committed Feb 10, 2011
1 parent ced4266 commit e9f44cc
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions Source/Widgets/ART.SplitView.js
Expand Up @@ -318,7 +318,7 @@ var splitter = {
return this;
},

toggle: function(side, hideSplitter, immediate) {
toggle: function(side, hideSplitter, immediate, width) {
var getWidthStr = function(side) {
return {
'left': 'leftWidth',
Expand All @@ -328,11 +328,18 @@ var splitter = {
}[side];
};
var toggle = getWidthStr(side);
var other = this._getOtherSide(side);;
var current = this[toggle];
var previous = this._previous[side];
if (previous == null) previous = this[other];
var to = current == 0 ? previous : 0;
var to = 0;
if (current == 0) {
if (width) {
to = width;
} else {
var other = this._getOtherSide(side);;
var previous = this._previous[side];
if (previous == null) return this;
to = previous;
}
}
this.fold(side, to, hideSplitter, immediate);
return this;
},
Expand Down

0 comments on commit e9f44cc

Please sign in to comment.