1
0
Fork 0
forked from 0x2620/oxjs

splitpanel rewrite

This commit is contained in:
rolux 2011-03-03 22:26:17 +01:00
commit 1e4a83a7c9
4 changed files with 42 additions and 30 deletions

View file

@ -11170,7 +11170,7 @@ requires
return that;
};
Ox.SplitPanel2 = function(options, self) {
Ox.SplitPanel = function(options, self) {
var self = self || {},
that = new Ox.Element('div', self)
@ -11180,7 +11180,7 @@ requires
})
.options(options)
.addClass(
'OxSplitPanel2 Ox' + Ox.toTitleCase(self.options.orientation)
'OxSplitPanel Ox' + Ox.toTitleCase(self.options.orientation)
);
Ox.extend(self, {
@ -11318,13 +11318,16 @@ requires
function setPercent(pos) {
var element = self.options.elements[pos],
flex = element.size.replace('%', ''),
flex = (
element.size == 'auto' ? self.autoPercent : element.size
).replace('%', ''),
css = {
boxFlex: flex,
MozBoxFlex: flex,
WebkitBoxFlex: flex
};
css[self.dimensions[0]] = '';
Ox.print('setPercent', css)
element.element.css(css);
}
@ -11349,6 +11352,27 @@ requires
});
}
that.replaceElement = function(pos, element) {
var $element = self.options.elements[pos].element;
$element.replaceWith(self.options.elements[pos].element = element);
if (Ox.isNumber(self.options.elements[pos].size)) {
setPixels(pos);
} else {
setPercent(pos);
}
return that;
};
that.resizeElement = function(pos, size) {
var element = self.options.elements[pos];
element.size = size;
if (Ox.isNumber(element.size)) {
setPixels(pos);
} else {
setPercent(pos);
}
}
that.toggle = function(pos) {
var css = {},
element = self.options.elements[pos],
@ -11395,7 +11419,7 @@ requires
resize
toggle
*/
Ox.SplitPanel = function(options, self) {
Ox._SplitPanel = function(options, self) {
var self = self || {},
that = new Ox.Element({}, self) // fixme: Container
.defaults({