1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
var Manager = {
[...code...]
setPageSize: function (a) {
this.pageSize = a || 0;
this.sendRequest()
},
setPage: function (a) {
this.page = a;
this.sendRequest(true)
},
sendRequest: function (c) {
this.page = c ? this.page : 1;
var b = this.sent ? "ul#product_list" : "div#center_column";
var d = $jq(b).innerWidth();
var a = $jq(b).innerHeight();
var f = $jq(b).outerWidth() / 2 - 25;
var e = $jq(b).outerHeight() / 2 - 25;
$jq(b).css("position", "relative");
if ($jq(b + " #loadingMask").length == 0) {
$jq(b).append('<div id="loadingMask" style="position:absolute;top:0;left:0;opacity:.4;width:' + d + "px;height:" + a + 'px;background-color:#fff"></div><div style="position:absolute;top:' + e + "px;left:" + f + 'px"><img height="50px" src="' + baseDir + '/modules/filterproductsplus/loading.gif"/></div>')
}
if (this.request) {
this.request.abort()
}
this.request = $jq.post(this.getURI(), {
data: JSON.stringify(this.data)
}, function (g) {
$jq("div#center_column").html(g);
$jq(b).css("position", "")
});
this.sent = 1
}
}; |
Partager