fix toggleOption method

This commit is contained in:
rolux 2012-06-02 12:00:52 +02:00
parent 4434e063bc
commit 9b6b6fd356

View file

@ -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;
};
/*@