forked from 0x2620/oxjs
avoid leaks by adding custom empty/remove/replaceWith functions to Ox.Element
This commit is contained in:
parent
90bc4fb59e
commit
7848277593
4 changed files with 41 additions and 14 deletions
|
|
@ -20,8 +20,9 @@ Ox.Focus = (function() {
|
|||
blur: function(id) {
|
||||
var index = stack.indexOf(id);
|
||||
if (index > -1 && index == stack.length - 1) {
|
||||
stack.length == 1 ? stack.pop() :
|
||||
stack.splice(stack.length - 2, 0, stack.pop());
|
||||
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');
|
||||
|
|
@ -48,6 +49,10 @@ Ox.Focus = (function() {
|
|||
@*/
|
||||
focused: function() {
|
||||
return stack.length ? stack[stack.length - 1] : null;
|
||||
},
|
||||
remove: function(id) {
|
||||
var index = stack.indexOf(id);
|
||||
index > -1 && stack.splice(index, 1);
|
||||
}
|
||||
};
|
||||
}());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue