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
|
|
@ -13,8 +13,8 @@ Ox.Dialog = function(options, self) {
|
|||
|
||||
// fixme: dialog should be derived from a generic draggable
|
||||
// fixme: buttons should have a close attribute, or the dialog a close id
|
||||
var self = self || {},
|
||||
that = new Ox.Element({}, self)
|
||||
self = self || {};
|
||||
var that = Ox.Element({}, self)
|
||||
.defaults({
|
||||
title: '',
|
||||
buttons: [],
|
||||
|
|
@ -43,9 +43,9 @@ Ox.Dialog = function(options, self) {
|
|||
$.extend(self, {
|
||||
initialWidth: self.options.width,
|
||||
initialHeight: self.options.height
|
||||
})
|
||||
});
|
||||
|
||||
that.$titlebar = new Ox.Bar({
|
||||
that.$titlebar = Ox.Bar({
|
||||
size: 'medium'
|
||||
})
|
||||
.addClass('OxTitleBar')
|
||||
|
|
@ -57,12 +57,12 @@ Ox.Dialog = function(options, self) {
|
|||
drag: drag
|
||||
});
|
||||
|
||||
that.$title = new Ox.Element()
|
||||
that.$title = Ox.Element()
|
||||
.addClass('OxTitle')
|
||||
.html(self.options.title)
|
||||
.appendTo(that.$titlebar);
|
||||
|
||||
that.$content = new Ox.Element()
|
||||
that.$content = Ox.Element()
|
||||
.addClass('OxContent')
|
||||
.css({
|
||||
padding: self.options.padding + 'px',
|
||||
|
|
@ -71,14 +71,14 @@ Ox.Dialog = function(options, self) {
|
|||
.append(self.options.content)
|
||||
.appendTo(that);
|
||||
|
||||
that.$buttonsbar = new Ox.Bar({})
|
||||
that.$buttonsbar = Ox.Bar({})
|
||||
.addClass('OxButtonsBar')
|
||||
.appendTo(that);
|
||||
loadButtons();
|
||||
|
||||
//that.$buttons[0].focus();
|
||||
|
||||
that.$layer = new Ox.Element() // fixme: Layer widget that would handle click?
|
||||
that.$layer = Ox.Element() // fixme: Layer widget that would handle click?
|
||||
.addClass('OxLayer')
|
||||
.mousedown(mousedownLayer)
|
||||
.mouseup(mouseupLayer);
|
||||
|
|
@ -224,7 +224,7 @@ Ox.Dialog = function(options, self) {
|
|||
.appendTo(that.$buttonsbar);
|
||||
});
|
||||
if (self.options.resizable) {
|
||||
that.$resize = new Ox.Element()
|
||||
that.$resize = Ox.Element()
|
||||
.addClass('OxResize')
|
||||
.dblclick(reset)
|
||||
.bindEvent({
|
||||
|
|
@ -304,7 +304,7 @@ Ox.Dialog = function(options, self) {
|
|||
}, 100);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
that.center = function() {
|
||||
|
||||
|
|
@ -323,14 +323,14 @@ Ox.Dialog = function(options, self) {
|
|||
that.removeElement();
|
||||
callback();
|
||||
});
|
||||
Ox.UI.$window.unbind('mouseup', mouseupLayer)
|
||||
Ox.UI.$window.unbind('mouseup', mouseupLayer);
|
||||
return that;
|
||||
};
|
||||
|
||||
that.content = function($element) {
|
||||
that.$content.empty().append($element);
|
||||
return that;
|
||||
}
|
||||
};
|
||||
|
||||
that.disable = function() {
|
||||
// to be used on submit of form, like login
|
||||
|
|
@ -369,7 +369,7 @@ Ox.Dialog = function(options, self) {
|
|||
reset();
|
||||
// fixme: the following line prevents preview-style dialog
|
||||
that.gainFocus();
|
||||
Ox.UI.$window.bind('mouseup', mouseupLayer)
|
||||
Ox.UI.$window.bind('mouseup', mouseupLayer);
|
||||
//Ox.print('after open')
|
||||
return that;
|
||||
};
|
||||
|
|
@ -391,7 +391,7 @@ Ox.Dialog = function(options, self) {
|
|||
that.$content.height(self.options.height - 48 - 2 * self.options.padding); // fixme: this should happen automatically
|
||||
callback();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
return that;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue