forked from 0x2620/oxjs
remove new for all Ox.Elements, dont declare arguments again, add some semicolons
This commit is contained in:
parent
3eab11e967
commit
b27ed00356
69 changed files with 430 additions and 440 deletions
|
|
@ -14,8 +14,9 @@ Ox.CollapsePanel <f:Ox.Panel> CollapsePanel Object
|
|||
@*/
|
||||
|
||||
Ox.CollapsePanel = function(options, self) {
|
||||
var self = self || {},
|
||||
that = new Ox.Panel({}, self)
|
||||
|
||||
self = self || {};
|
||||
var that = Ox.Panel({}, self)
|
||||
.defaults({
|
||||
collapsed: false,
|
||||
extras: [],
|
||||
|
|
@ -28,33 +29,33 @@ Ox.CollapsePanel = function(options, self) {
|
|||
title = self.options.collapsed ?
|
||||
[{id: 'expand', title: 'right'}, {id: 'collapse', title: 'down'}] :
|
||||
[{id: 'collapse', title: 'down'}, {id: 'expand', title: 'right'}],
|
||||
$titlebar = new Ox.Bar({
|
||||
$titlebar = Ox.Bar({
|
||||
orientation: 'horizontal',
|
||||
size: self.options.size,
|
||||
})
|
||||
.dblclick(dblclickTitlebar)
|
||||
.appendTo(that),
|
||||
$switch = new Ox.Button({
|
||||
$switch = Ox.Button({
|
||||
style: 'symbol',
|
||||
title: title,
|
||||
type: 'image',
|
||||
})
|
||||
.click(toggleCollapsed)
|
||||
.appendTo($titlebar),
|
||||
$title = new Ox.Element()
|
||||
$title = Ox.Element()
|
||||
.addClass('OxTitle')
|
||||
.html(self.options.title/*.toUpperCase()*/)
|
||||
.appendTo($titlebar),
|
||||
$extras;
|
||||
if (self.options.extras.length) {
|
||||
$extras = new Ox.Element()
|
||||
$extras = Ox.Element()
|
||||
.addClass('OxExtras')
|
||||
.appendTo($titlebar);
|
||||
self.options.extras.forEach(function($extra) {
|
||||
$extra.appendTo($extras);
|
||||
});
|
||||
}
|
||||
that.$content = new Ox.Element()
|
||||
that.$content = Ox.Element()
|
||||
.addClass('OxContent')
|
||||
.appendTo(that);
|
||||
// fixme: doesn't work, content still empty
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ Ox.Panel <f:Ox.Element> Panel Object
|
|||
@*/
|
||||
|
||||
Ox.Panel = function(options, self) {
|
||||
var self = self || {},
|
||||
that = new Ox.Element({}, self)
|
||||
self = self || {};
|
||||
var that = Ox.Element({}, self)
|
||||
.addClass('OxPanel');
|
||||
return that;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ Ox.SplitPanel <f:Ox.Element> SpliPanel Object
|
|||
*/
|
||||
Ox.SplitPanel = function(options, self) {
|
||||
|
||||
var self = self || {},
|
||||
that = new Ox.Element({}, self) // fixme: Container
|
||||
self = self || {};
|
||||
var that = Ox.Element({}, self) // fixme: Container
|
||||
.defaults({
|
||||
elements: [],
|
||||
orientation: 'horizontal'
|
||||
|
|
@ -72,7 +72,7 @@ Ox.SplitPanel = function(options, self) {
|
|||
if (v.collapsible || v.resizable) {
|
||||
//Ox.print('v.size', v.size)
|
||||
self.resizebarElements[index] = i < 2 ? [0, 1] : [1, 2];
|
||||
self.$resizebars[index] = new Ox.Resizebar({
|
||||
self.$resizebars[index] = Ox.Resizebar({
|
||||
collapsible: v.collapsible,
|
||||
edge: self.edges[index],
|
||||
elements: [
|
||||
|
|
@ -211,7 +211,7 @@ Ox.SplitPanel = function(options, self) {
|
|||
});
|
||||
});
|
||||
return that;
|
||||
}
|
||||
};
|
||||
|
||||
that.size = function(id, size) {
|
||||
// one can pass pos instead of id
|
||||
|
|
@ -255,9 +255,9 @@ Ox.SplitPanel = function(options, self) {
|
|||
|
||||
that.updateSize = function(pos, size) {
|
||||
// this is called from resizebar
|
||||
var pos = pos == 0 ? 0 : self.options.elements.length - 1; // fixme: silly that 0 or 1 is passed, and not pos
|
||||
pos = pos == 0 ? 0 : self.options.elements.length - 1; // fixme: silly that 0 or 1 is passed, and not pos
|
||||
self.options.elements[pos].size = size;
|
||||
}
|
||||
};
|
||||
|
||||
return that;
|
||||
|
||||
|
|
@ -265,8 +265,8 @@ Ox.SplitPanel = function(options, self) {
|
|||
|
||||
Ox.SplitPanel_ = function(options, self) {
|
||||
|
||||
var self = self || {},
|
||||
that = new Ox.Element({}, self)
|
||||
self = self || {};
|
||||
var that = Ox.Element({}, self)
|
||||
.defaults({
|
||||
elements: [],
|
||||
orientation: 'horizontal'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue