aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-04-25 08:10:39 -0400
committerScott González <scott.gonzalez@gmail.com>2011-04-25 08:11:52 -0400
commitc4c36e557ef2b3450bc365708064f7314bc6fdc4 (patch)
tree118b1f85496ec0118b31f2bcdbffbfd685ac5684
parent6326da3fdb29ea4f40e39bc06abf14cde5ba5c8c (diff)
downloadjquery-ui-c4c36e557ef2b3450bc365708064f7314bc6fdc4.tar.gz
jquery-ui-c4c36e557ef2b3450bc365708064f7314bc6fdc4.zip
Accordion, Autocomplete, Tabs: Separate callbacks and options in the defaults.
-rw-r--r--tests/unit/accordion/accordion_defaults.js6
-rw-r--r--tests/unit/accordion/accordion_defaults_deprecated.js8
-rw-r--r--tests/unit/autocomplete/autocomplete_defaults.js41
-rw-r--r--tests/unit/tabs/tabs_defaults.js8
-rw-r--r--tests/unit/tabs/tabs_defaults_deprecated.js22
-rw-r--r--ui/jquery.ui.accordion.js11
-rw-r--r--ui/jquery.ui.autocomplete.js11
-rwxr-xr-xui/jquery.ui.tabs.js8
8 files changed, 77 insertions, 38 deletions
diff --git a/tests/unit/accordion/accordion_defaults.js b/tests/unit/accordion/accordion_defaults.js
index 95a478057..847a394e2 100644
--- a/tests/unit/accordion/accordion_defaults.js
+++ b/tests/unit/accordion/accordion_defaults.js
@@ -10,6 +10,10 @@ commonWidgetTests( "accordion", {
icons: {
"activeHeader": "ui-icon-triangle-1-s",
"header": "ui-icon-triangle-1-e"
- }
+ },
+
+ // callbacks
+ activate: null,
+ beforeActivate: null
}
});
diff --git a/tests/unit/accordion/accordion_defaults_deprecated.js b/tests/unit/accordion/accordion_defaults_deprecated.js
index b90b472e2..bdc059d10 100644
--- a/tests/unit/accordion/accordion_defaults_deprecated.js
+++ b/tests/unit/accordion/accordion_defaults_deprecated.js
@@ -16,6 +16,12 @@ commonWidgetTests( "accordion", {
"headerSelected": "ui-icon-triangle-1-s"
},
navigation: false,
- navigationFilter: function() {}
+ navigationFilter: function() {},
+
+ // callbacks
+ activate: null,
+ beforeActivate: null,
+ change: null,
+ changestart: null
}
});
diff --git a/tests/unit/autocomplete/autocomplete_defaults.js b/tests/unit/autocomplete/autocomplete_defaults.js
index dd5007089..05897b848 100644
--- a/tests/unit/autocomplete/autocomplete_defaults.js
+++ b/tests/unit/autocomplete/autocomplete_defaults.js
@@ -1,19 +1,24 @@
-/*
- * autocomplete_defaults.js
- */
+commonWidgetTests( "autocomplete", {
+ defaults: {
+ appendTo: "body",
+ autoFocus: false,
+ delay: 300,
+ disabled: false,
+ minLength: 1,
+ position: {
+ my: "left top",
+ at: "left bottom",
+ collision: "none"
+ },
+ source: null,
-var autocomplete_defaults = {
- appendTo: "body",
- autoFocus: false,
- delay: 300,
- disabled: false,
- minLength: 1,
- position: {
- my: "left top",
- at: "left bottom",
- collision: "none"
- },
- source: null
-};
-
-commonWidgetTests('autocomplete', { defaults: autocomplete_defaults });
+ // callbacks
+ change: null,
+ close: null,
+ focus: null,
+ open: null,
+ response: null,
+ search: null,
+ select: null
+ }
+});
diff --git a/tests/unit/tabs/tabs_defaults.js b/tests/unit/tabs/tabs_defaults.js
index e15d618de..0750094e4 100644
--- a/tests/unit/tabs/tabs_defaults.js
+++ b/tests/unit/tabs/tabs_defaults.js
@@ -1,13 +1,15 @@
commonWidgetTests( "tabs", {
defaults: {
- activate: null,
active: null,
- beforeLoad: null,
- beforeActivate: null,
collapsible: false,
disabled: false,
event: "click",
fx: null,
+
+ // callbacks
+ activate: null,
+ beforeActivate: null,
+ beforeLoad: null,
load: null
}
});
diff --git a/tests/unit/tabs/tabs_defaults_deprecated.js b/tests/unit/tabs/tabs_defaults_deprecated.js
index 2d9772c6d..84f7de073 100644
--- a/tests/unit/tabs/tabs_defaults_deprecated.js
+++ b/tests/unit/tabs/tabs_defaults_deprecated.js
@@ -1,26 +1,28 @@
commonWidgetTests( "tabs", {
defaults: {
- activate: null,
active: null,
- add: null,
ajaxOptions: null,
- beforeLoad: null,
- beforeActivate: null,
cache: false,
collapsible: false,
cookie: null,
- disable: null,
disabled: false,
- enable: null,
event: "click",
fx: null,
idPrefix: "ui-tabs-",
- load: null,
panelTemplate: "<div></div>",
+ spinner: "<em>Loading&#8230;</em>",
+ tabTemplate: "<li><a href='#{href}'><span>#{label}</span></a></li>",
+
+ // callbacks
+ activate: null,
+ add: null,
+ beforeActivate: null,
+ beforeLoad: null,
+ disable: null,
+ enable: null,
+ load: null,
remove: null,
select: null,
- show: null,
- spinner: "<em>Loading&#8230;</em>",
- tabTemplate: "<li><a href='#{href}'><span>#{label}</span></a></li>"
+ show: null
}
});
diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js
index 455c66a28..0cc1f9e2a 100644
--- a/ui/jquery.ui.accordion.js
+++ b/ui/jquery.ui.accordion.js
@@ -25,7 +25,11 @@ $.widget( "ui.accordion", {
icons: {
activeHeader: "ui-icon-triangle-1-s",
header: "ui-icon-triangle-1-e"
- }
+ },
+
+ // callbacks
+ activate: null,
+ beforeActivate: null
},
_create: function() {
@@ -649,6 +653,11 @@ if ( $.uiBackCompat !== false ) {
// change events
(function( $, prototype ) {
+ $.extend( prototype.options, {
+ change: null,
+ changestart: null
+ });
+
var _trigger = prototype._trigger;
prototype._trigger = function( type, event, data ) {
var ret = _trigger.apply( this, arguments );
diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js
index 1685c0652..526eb3869 100644
--- a/ui/jquery.ui.autocomplete.js
+++ b/ui/jquery.ui.autocomplete.js
@@ -30,7 +30,16 @@ $.widget( "ui.autocomplete", {
at: "left bottom",
collision: "none"
},
- source: null
+ source: null,
+
+ // callbacks
+ change: null,
+ close: null,
+ focus: null,
+ open: null,
+ response: null,
+ search: null,
+ select: null
},
pending: 0,
diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js
index 699c1a5ee..82d3f186d 100755
--- a/ui/jquery.ui.tabs.js
+++ b/ui/jquery.ui.tabs.js
@@ -26,13 +26,15 @@ function getNextListId() {
$.widget( "ui.tabs", {
options: {
- activate: null,
active: null,
- beforeActivate: null,
- beforeLoad: null,
collapsible: false,
event: "click",
fx: null, // e.g. { height: 'toggle', opacity: 'toggle', duration: 200 }
+
+ // callbacks
+ activate: null,
+ beforeActivate: null,
+ beforeLoad: null,
load: null
},