dont depend on Ox.Element in Ox.Request instantiation

This commit is contained in:
j 2012-01-19 19:10:35 +05:30
parent 216ad5f44f
commit f7755eb303

View file

@ -13,7 +13,7 @@ Ox.Request = (function() {
var cache = {},
//dfd = $.Deferred(),
$element = Ox.Element(),
$element,
pending = {},
requests = {},
self = {
@ -63,7 +63,12 @@ Ox.Request = (function() {
/*@
bindEvent <f> bindEvent to error/authrize requests
@*/
bindEvent: $element.bindEvent,
bindEvent: function() {
if(!$element) {
$element = Ox.Element();
}
$element.bindEvent.apply(this, arguments);
},
// fixme: remove
_leakCache: function() {
@ -189,6 +194,13 @@ Ox.Request = (function() {
return options.id;
},
/*@
unbindEvent <f> unbindEvent for error/authrize requests
@*/
unbindEvent: function() {
$element && $element.unbindEvent.apply(this, arguments);
}
};