1
0
Fork 0
forked from 0x2620/oxjs

better list demo

This commit is contained in:
Rolux 2010-07-02 01:51:08 +02:00
commit a62a18cb58
3 changed files with 91 additions and 47 deletions

View file

@ -637,10 +637,18 @@ Menus
background: rgb(48, 48, 48);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, rgb(80, 80, 80)), color-stop(1, rgb(48, 48, 48)));
}
.OxMainMenu > .OxExtras {
.OxMainMenu.OxLarge > .OxExtras {
float: right;
padding: 4px 12px 0 0;
}
.OxMainMenu.OxMedium > .OxExtras {
float: right;
padding: 2px 10px 0 0;
}
.OxMainMenu.OxSmall > .OxExtras {
float: right;
padding: 2px 8px 0 0;
}
.OxMenu {

View file

@ -204,7 +204,6 @@ requires
// use dom elements / jquery instead
Ox.Event = function() {
var keyboardEvents = {};
$eventHandler = $("<div>");
@ -532,8 +531,6 @@ requires
Ox.Request = function() {
// chained requests, make cancelable: id = 4.7.9
var cache = {},
pending = {},
requests = {},
@ -574,22 +571,22 @@ requires
send: function(options) {
options = $.extend({
age: -1,
callback: function() {},
id: Ox.uid(),
timeout: self.options.timeout,
type: self.options.type,
url: self.options.url
}, options);
var req = JSON.stringify({
var options = $.extend({
age: -1,
callback: function() {},
id: Ox.uid(),
timeout: self.options.timeout,
type: self.options.type,
url: self.options.url
}, options),
req = JSON.stringify({
url: options.url,
data: options.data
});
function callback(data) {
delete requests[options.id];
Ox.length(requests) == 0 && Ox.Event.trigger("requestStop");
options.callback(data);
}
@ -718,9 +715,16 @@ requires
type: options.type,
url: options.url
});
Ox.length(requests) == 1 && Ox.Event.trigger("requestStart");
}
}
return options.id;
},
requests: function() {
return Ox.length(requests);
}
};
@ -4208,8 +4212,15 @@ requires
.addClass(
"OxLoadingIcon Ox" + Ox.toTitleCase(self.options.size)
);
self.count = 0;
self.deg = 0;
self.interval = 0;
self.isRunning = false;
function clear() {
clearInterval(self.interval);
self.deg = 0;
self.interval = 0;
update();
}
function update() {
that.css({
MozTransform: "rotate(" + self.deg + "deg)",
@ -4217,28 +4228,23 @@ requires
});
}
that.start = function() {
self.deg = 0;
self.count++;
if (self.count == 1) {
that.animate({
opacity: 1
}, 250);
self.interval = setInterval(function() {
self.deg = (self.deg + 30) % 360;
update();
}, 83);
}
self.isRunning = true;
clear();
that.animate({
opacity: 1
}, 250);
self.interval = setInterval(function() {
self.deg = (self.deg + 30) % 360;
update();
}, 83);
};
that.stop = function() {
self.count--;
if (self.count == 0) {
that.animate({
opacity: 0
}, 250, function() {
clearTimeout(self.interval);
self.deg = 0;
});
}
that.animate({
opacity: 0
}, 250, function() {
!self.isRunning && clear();
self.isRunning = false;
});
}
return that;
}