fix toggleOption method
This commit is contained in:
parent
4434e063bc
commit
9b6b6fd356
1 changed files with 6 additions and 4 deletions
|
@ -420,25 +420,27 @@ Ox.Element = function(options, self) {
|
|||
|
||||
/*@
|
||||
setElement <f> set $element
|
||||
($element) -> null
|
||||
($element) -> <o> This element
|
||||
@*/
|
||||
that.setElement = function($element) {
|
||||
$element.addClass('OxElement').data({oxid: that.oxid});
|
||||
that.$element.replaceWith($element);
|
||||
that.$element = $element;
|
||||
that[0] = that.$element[0];
|
||||
return that;
|
||||
};
|
||||
|
||||
/*@
|
||||
toggleOption <f> toggle option
|
||||
() -> <o> object
|
||||
toggleOption <f> Toggle boolean option(s)
|
||||
(key[, key[, ...]]) -> <o> This element
|
||||
@*/
|
||||
that.toggleOption = function() {
|
||||
var options = {};
|
||||
Ox.makeArray(arguments[0]).forEach(function(key) {
|
||||
Ox.toArray(arguments).forEach(function(key) {
|
||||
options[key] == !self.options[key];
|
||||
});
|
||||
that.options(options);
|
||||
return that;
|
||||
};
|
||||
|
||||
/*@
|
||||
|
|
Loading…
Reference in a new issue