equals(actual, expected, 'destroy is chainable');
});
+test('value', function() {
+ expect(3);
+
+ var el = $('<div></div>').progressbar({ value: 20 });
+ equals(el.progressbar('value'), 20, 'correct value as getter');
+ equals(el.progressbar('value', 30), el, 'chainable as setter');
+ equals(el.progressbar('option', 'value'), 30, 'correct value after setter');
+});
+
})(jQuery);
},
value: function(newValue) {
- arguments.length && this._setData("value", newValue);
- return this._value();
+ if (newValue === undefined) {
+ return this._value();
+ }
+
+ this._setData('value', newValue);
+ return this;
},
_setData: function(key, value) {