forked from 0x2620/oxjs
various annotation-related bugfixes
This commit is contained in:
parent
198e11c59b
commit
a7a3f167c9
10 changed files with 135 additions and 75 deletions
|
|
@ -24,10 +24,14 @@ Ox.Focus = (function() {
|
|||
stack.length == 1
|
||||
? stack.pop()
|
||||
: stack.splice(stack.length - 2, 0, stack.pop());
|
||||
//$elements[id].removeClass('OxFocus');
|
||||
$('.OxFocus').removeClass('OxFocus'); // fixme: the above is better, and should work
|
||||
stack.length && Ox.UI.elements[stack[stack.length - 1]]
|
||||
.addClass('OxFocus')/*.triggerEvent('focus')*/;
|
||||
Ox.UI.elements[id]
|
||||
.removeClass('OxFocus')
|
||||
.triggerEvent('losefocus');
|
||||
if (stack.length) {
|
||||
Ox.UI.elements[stack[stack.length - 1]]
|
||||
.addClass('OxFocus')
|
||||
.triggerEvent('gainfocus')
|
||||
}
|
||||
Ox.Log('Core', 'blur', id, stack);
|
||||
}
|
||||
},
|
||||
|
|
@ -40,10 +44,16 @@ Ox.Focus = (function() {
|
|||
if (index == -1 || index < stack.length - 1) {
|
||||
index > -1 && stack.splice(index, 1);
|
||||
stack.push(id);
|
||||
$('.OxFocus').removeClass('OxFocus'); // fixme: see above
|
||||
Ox.Log('Core', 'focus', id, stack);
|
||||
if (stack.length > 1) {
|
||||
Ox.print('...', Object.keys(Ox.UI.elements[stack[stack.length - 2]]))
|
||||
Ox.UI.elements[stack[stack.length - 2]]
|
||||
.removeClass('OxFocus')
|
||||
.triggerEvent('losefocus')
|
||||
}
|
||||
Ox.UI.elements[id]
|
||||
.addClass('OxFocus')/*.triggerEvent('focus')*/;
|
||||
.addClass('OxFocus')
|
||||
.triggerEvent('gainfocus');
|
||||
Ox.Log('Core', 'focus', id, stack);
|
||||
}
|
||||
},
|
||||
/*@
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ Ox.LoadingIcon <f:Ox.Element> Loading Icon Element
|
|||
@*/
|
||||
|
||||
Ox.LoadingIcon = function(options, self) {
|
||||
|
||||
self = self || {};
|
||||
var that = Ox.Element('<img>', self)
|
||||
.defaults({
|
||||
|
|
@ -23,6 +24,11 @@ Ox.LoadingIcon = function(options, self) {
|
|||
.addClass(
|
||||
'OxLoadingIcon Ox' + Ox.toTitleCase(self.options.size)
|
||||
);
|
||||
|
||||
self.setOption = function(key, value) {
|
||||
|
||||
};
|
||||
|
||||
/*@
|
||||
start <f> Start loading animation
|
||||
() -> <f> Loading Icon Element
|
||||
|
|
@ -36,6 +42,7 @@ Ox.LoadingIcon = function(options, self) {
|
|||
}, 250);
|
||||
return that;
|
||||
};
|
||||
|
||||
/*@
|
||||
stop <f> Stop loading animation
|
||||
() -> <f> Loading Icon Element
|
||||
|
|
@ -50,5 +57,7 @@ Ox.LoadingIcon = function(options, self) {
|
|||
});
|
||||
return that;
|
||||
};
|
||||
|
||||
return that;
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -46,6 +46,9 @@ Ox.Request = (function() {
|
|||
// cancel by id
|
||||
delete requests[arguments[0]];
|
||||
}
|
||||
$element && $element.triggerEvent('request', {
|
||||
requests: Ox.len(requests)
|
||||
});
|
||||
},
|
||||
/*@
|
||||
clearCache <f> clear cached results
|
||||
|
|
@ -60,11 +63,12 @@ Ox.Request = (function() {
|
|||
});
|
||||
}
|
||||
},
|
||||
|
||||
/*@
|
||||
bindEvent <f> bindEvent to error/authrize requests
|
||||
bindEvent <f> Unbind event
|
||||
@*/
|
||||
bindEvent: function() {
|
||||
if(!$element) {
|
||||
if (!$element) {
|
||||
$element = Ox.Element();
|
||||
}
|
||||
$element.bindEvent.apply(this, arguments);
|
||||
|
|
@ -146,12 +150,18 @@ Ox.Request = (function() {
|
|||
url: options.url
|
||||
});
|
||||
}
|
||||
$element && $element.triggerEvent('request', {
|
||||
requests: Ox.len(requests)
|
||||
});
|
||||
}
|
||||
|
||||
function callback(data) {
|
||||
if (requests[options.id]) {
|
||||
delete requests[options.id];
|
||||
options.callback && options.callback(data);
|
||||
$element && $element.triggerEvent('request', {
|
||||
requests: Ox.len(requests)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -197,7 +207,7 @@ Ox.Request = (function() {
|
|||
},
|
||||
|
||||
/*@
|
||||
unbindEvent <f> unbindEvent for error/authrize requests
|
||||
unbindEvent <f> Unbind event
|
||||
@*/
|
||||
unbindEvent: function() {
|
||||
$element && $element.unbindEvent.apply(this, arguments);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue