add load event to list
This commit is contained in:
parent
a5c5ab7e4d
commit
0ea96e3810
6 changed files with 188 additions and 70 deletions
|
|
@ -186,6 +186,13 @@ Scrollbars
|
|||
.OxThemeModern ::-webkit-scrollbar {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
}
|
||||
.OxThemeModern ::-webkit-scrollbar:horizontal {
|
||||
border-top: 1px solid rgb(48, 48, 48);
|
||||
border-bottom: 1px solid rgb(48, 48, 48);
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(rgb(96, 96, 96)), to(rgb(64, 64, 64)));
|
||||
}
|
||||
.OxThemeModern ::-webkit-scrollbar:vertical {
|
||||
border-left: 1px solid rgb(48, 48, 48);
|
||||
border-right: 1px solid rgb(48, 48, 48);
|
||||
background: -webkit-gradient(linear, left top, right top, from(rgb(96, 96, 96)), to(rgb(64, 64, 64)));
|
||||
|
|
@ -206,6 +213,11 @@ Scrollbars
|
|||
.OxThemeModern ::-webkit-scrollbar-button:vertical:increment {
|
||||
background: url(../png/ox.ui.modern/scrollbarVerticalIncrement.png);
|
||||
}
|
||||
.OxThemeModern ::-webkit-scrollbar-corner {
|
||||
border-right: 1px solid rgb(48, 48, 48);
|
||||
border-bottom: 1px solid rgb(48, 48, 48);
|
||||
background: -webkit-gradient(linear, left top, right bottom, from(rgb(96, 96, 96)), to(rgb(32, 32, 32)));
|
||||
}
|
||||
.OxThemeModern ::-webkit-scrollbar-thumb {
|
||||
border: 1px solid rgb(48, 48, 48);
|
||||
-webkit-border-radius: 6px;
|
||||
|
|
|
|||
|
|
@ -1172,6 +1172,32 @@ Ox.formatDate = function() {
|
|||
};
|
||||
}();
|
||||
|
||||
Ox.formatDuration = function(sec, day, dec) {
|
||||
/*
|
||||
>>> Ox.formatDuration(123456.789, 3)
|
||||
1:10:17:36.789
|
||||
>>> Ox.formatDuration(12345.6789)
|
||||
03:25:46
|
||||
>>> Ox.formatDuration(12345.6789, true)
|
||||
0:03:25:46
|
||||
>>> Ox.formatDuration(3599.999, 3)
|
||||
00:59:59.999
|
||||
>>> Ox.formatDuration(3599.999)
|
||||
01:00:00
|
||||
*/
|
||||
var dec = arguments.length == 3 ? dec : (Ox.isNumber(day) ? day : 0),
|
||||
day = arguments.length == 3 ? day : (Ox.isBoolean(day) ? day : false),
|
||||
sec = dec ? sec : Math.round(sec),
|
||||
arr = [
|
||||
Math.floor(sec / 86400),
|
||||
Ox.pad(Math.floor(sec % 86400 / 3600), 2),
|
||||
Ox.pad(Math.floor(sec % 3600 / 60), 2),
|
||||
Ox.pad(Ox.formatNumber(sec % 60, dec, true), dec ? dec + 3 : 2)
|
||||
];
|
||||
!arr[0] && !day && arr.shift();
|
||||
return arr.join(":");
|
||||
};
|
||||
|
||||
Ox.formatNumber = function(num, dec) {
|
||||
/*
|
||||
>>> Ox.formatNumber(123456789, 3)
|
||||
|
|
@ -1192,6 +1218,23 @@ Ox.formatNumber = function(num, dec) {
|
|||
return (num < 0 ? "-" : "") + spl.join(".");
|
||||
};
|
||||
|
||||
Ox.formatValue = function(num, str) {
|
||||
/*
|
||||
>>> Ox.formatValue(0, "B")
|
||||
???
|
||||
>>> Ox.formatValue(123456789, "B")
|
||||
???
|
||||
*/
|
||||
var val = "";
|
||||
$.each(["K", "M", "G", "T", "P"], function(i, v) {
|
||||
if (num < Math.pow(1024, i + 2) || i == len - 1) {
|
||||
val = Ox.formatNumber(num / Math.pow(1024, i + 1), i) + " " + v + str;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return val;
|
||||
};
|
||||
|
||||
/*
|
||||
================================================================================
|
||||
Math functions
|
||||
|
|
|
|||
|
|
@ -2394,8 +2394,6 @@ requires
|
|||
.click(click)
|
||||
.scroll(scroll);
|
||||
|
||||
Ox.print("self.options.unique", self.options.unique)
|
||||
|
||||
$.extend(self, {
|
||||
$items: [],
|
||||
$pages: [],
|
||||
|
|
@ -2818,7 +2816,7 @@ requires
|
|||
self.requests.push(self.options.request({
|
||||
callback: function(result) {
|
||||
var keys = {};
|
||||
Ox.print("items", result.data.items);
|
||||
that.triggerEvent("load", result.data);
|
||||
$.extend(self, {
|
||||
listHeight: result.data.items * self.options.itemHeight, // fixme: should be listSize
|
||||
listLength: result.data.items,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue