aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChi Cheng <cloudream@gmail.com>2008-08-19 16:31:42 +0000
committerChi Cheng <cloudream@gmail.com>2008-08-19 16:31:42 +0000
commitc0147da718694cb5b571d2b2c4c206a1cd26012f (patch)
treee87a3afa49ebb934da971a687a0fbd8793870246
parentbf1d243ce7f9aba0f083e046eacca5ea4a40a6a6 (diff)
downloadjquery-ui-c0147da718694cb5b571d2b2c4c206a1cd26012f.tar.gz
jquery-ui-c0147da718694cb5b571d2b2c4c206a1cd26012f.zip
Spinner: ui() doesn't return instance
-rw-r--r--tests/spinner.js15
-rw-r--r--ui/ui.spinner.js9
2 files changed, 6 insertions, 18 deletions
diff --git a/tests/spinner.js b/tests/spinner.js
index 6bef26cd2..190da10a1 100644
--- a/tests/spinner.js
+++ b/tests/spinner.js
@@ -7,42 +7,33 @@
module("spinner");
test("init", function() {
- expect(3);
+ expect(2);
$("#spin").spinner();
ok(true, '.spinner() called on element');
- $([]).spinner().remove();
- ok(true, '.spinner() called on empty collection');
-
$('<input id="spinner_dis">').spinner().remove();
ok(true, '.spinner() called on disconnected element');
});
test("destroy", function() {
- expect(3);
+ expect(2);
$("#spin").spinner().spinner("destroy");
ok(true, '.spinner("destroy") called on element');
- $([]).spinner().spinner("destroy").remove();
- ok(true, '.spinner().spinner("destroy") called on empty collection');
-
$('<input id="spinner_dis">').spinner().spinner("destroy").remove();
ok(true, '.spinner().spinner("destroy") called on disconnected element');
});
test("re-attach", function() {
- expect(3);
+ expect(2);
el = $("#spin").spinner().spinner("destroy").spinner();
ok(true, '.spinner().spinner("destroy").spinner() called on element');
- $([]).spinner().spinner("destroy").spinner().remove();
- ok(true, '.spinner().spinner("destroy").spinner() called on empty collection');
-
$('<input id="spinner_dis">').spinner().spinner("destroy").spinner().remove();
ok(true, '.spinner().spinner("destroy").spinner() called on disconnected element');
diff --git a/ui/ui.spinner.js b/ui/ui.spinner.js
index c4820e227..1c39a4923 100644
--- a/ui/ui.spinner.js
+++ b/ui/ui.spinner.js
@@ -204,7 +204,6 @@ $.widget('ui.spinner', {
plugins: {},
ui: function(e) {
return {
- instance: this,
options: this.options,
element: this.element,
value: this._getValue()
@@ -216,7 +215,9 @@ $.widget('ui.spinner', {
},
destroy: function() {
if(!$.data(this.element[0], 'spinner')) return;
-
+ if ($.fn.mousewheel) {
+ this.element.unmousewheel();
+ }
this.element
.removeClass('ui-spinner-box')
.removeAttr('disabled')
@@ -230,10 +231,6 @@ $.widget('ui.spinner', {
.before(this.element.clone())
.remove()
.end();
-
- if ($.fn.mousewheel) {
- this.element.unmousewheel();
- }
},
enable: function() {
this.element