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
|
|
@ -41,8 +41,8 @@ Ox.List <f:Ox.Element> List Element
|
|||
|
||||
Ox.List = function(options, self) {
|
||||
|
||||
var self = self || {},
|
||||
that = new Ox.Container({}, self)
|
||||
self = self || {};
|
||||
var that = Ox.Container({}, self)
|
||||
.defaults({
|
||||
centered: false,
|
||||
construct: null,
|
||||
|
|
@ -274,11 +274,11 @@ Ox.List = function(options, self) {
|
|||
|
||||
function constructEmptyPage(page) {
|
||||
//Ox.print('cEP', page)
|
||||
var i, $page = new Ox.ListPage().css(getPageCSS(page));
|
||||
var i, $page = Ox.ListPage().css(getPageCSS(page));
|
||||
for (i = 0; i < getPageLength(page); i++
|
||||
) {
|
||||
// fixme: why does chainging fail here?
|
||||
new Ox.ListItem({
|
||||
Ox.ListItem({
|
||||
construct: self.options.construct
|
||||
}).appendTo($page);
|
||||
}
|
||||
|
|
@ -427,7 +427,7 @@ Ox.List = function(options, self) {
|
|||
visibleItems = Math.ceil(height / self.options.itemHeight);
|
||||
if (self.listLength < visibleItems) {
|
||||
Ox.range(self.listLength, visibleItems).forEach(function(v) {
|
||||
var $item = new Ox.ListItem({
|
||||
var $item = Ox.ListItem({
|
||||
construct: self.options.construct,
|
||||
});
|
||||
$item.addClass('OxEmpty').removeClass('OxTarget');
|
||||
|
|
@ -472,7 +472,7 @@ Ox.List = function(options, self) {
|
|||
function getAbove() {
|
||||
var pos = -1;
|
||||
if (self.selected.length) {
|
||||
pos = self.selected[self.selected.length - 1] - self.rowLength
|
||||
pos = self.selected[self.selected.length - 1] - self.rowLength;
|
||||
if (pos < 0) {
|
||||
pos = -1;
|
||||
}
|
||||
|
|
@ -543,7 +543,7 @@ Ox.List = function(options, self) {
|
|||
} : {
|
||||
top: (page * self.pageHeight + self.listMargin / 2) + 'px',
|
||||
width: self.pageWidth + 'px'
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function getPageHeight() {
|
||||
|
|
@ -622,7 +622,7 @@ Ox.List = function(options, self) {
|
|||
function getRowLength() {
|
||||
return self.options.orientation == 'both' ?
|
||||
Math.floor((getWidth() - self.listMargin) /
|
||||
(self.options.itemWidth + self.itemMargin)) : 1
|
||||
(self.options.itemWidth + self.itemMargin)) : 1;
|
||||
}
|
||||
|
||||
function getScrollPosition() {
|
||||
|
|
@ -703,10 +703,10 @@ Ox.List = function(options, self) {
|
|||
sort: self.options.sort
|
||||
}, function(result) {
|
||||
var $emptyPage = Ox.clone(self.$pages[page]);
|
||||
self.$pages[page] = new Ox.ListPage().css(getPageCSS(page));
|
||||
self.$pages[page] = Ox.ListPage().css(getPageCSS(page));
|
||||
result.data.items.forEach(function(v, i) {
|
||||
var pos = offset + i;
|
||||
self.$items[pos] = new Ox.ListItem({
|
||||
self.$items[pos] = Ox.ListItem({
|
||||
construct: self.options.construct,
|
||||
data: v,
|
||||
draggable: self.options.draggable,
|
||||
|
|
@ -1342,7 +1342,7 @@ Ox.List = function(options, self) {
|
|||
});
|
||||
items.forEach(function(item, i) {
|
||||
var $item;
|
||||
$items.push($item = new Ox.ListItem({
|
||||
$items.push($item = Ox.ListItem({
|
||||
construct: self.options.construct,
|
||||
data: item,
|
||||
draggable: self.options.draggable,
|
||||
|
|
@ -1383,7 +1383,7 @@ Ox.List = function(options, self) {
|
|||
.empty()
|
||||
.addClass('OxEdit');
|
||||
|
||||
$input = new Ox.ItemInput({
|
||||
$input = Ox.ItemInput({
|
||||
type: 'textarea',
|
||||
value: item.value,
|
||||
height: height,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue