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 setElement <f> set $element
($element) -> null ($element) -> <o> This element
@*/ @*/
that.setElement = function($element) { that.setElement = function($element) {
$element.addClass('OxElement').data({oxid: that.oxid}); $element.addClass('OxElement').data({oxid: that.oxid});
that.$element.replaceWith($element); that.$element.replaceWith($element);
that.$element = $element; that.$element = $element;
that[0] = that.$element[0]; that[0] = that.$element[0];
return that;
}; };
/*@ /*@
toggleOption <f> toggle option toggleOption <f> Toggle boolean option(s)
() -> <o> object (key[, key[, ...]]) -> <o> This element
@*/ @*/
that.toggleOption = function() { that.toggleOption = function() {
var options = {}; var options = {};
Ox.makeArray(arguments[0]).forEach(function(key) { Ox.toArray(arguments).forEach(function(key) {
options[key] == !self.options[key]; options[key] == !self.options[key];
}); });
that.options(options); that.options(options);
return that;
}; };
/*@ /*@