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