aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--demos/autocomplete/combobox.html2
-rw-r--r--tests/unit/widget/widget.js14
-rw-r--r--ui/jquery.ui.accordion.js2
-rw-r--r--ui/jquery.ui.autocomplete.js4
-rw-r--r--ui/jquery.ui.button.js4
-rw-r--r--ui/jquery.ui.dialog.js2
-rw-r--r--ui/jquery.ui.draggable.js2
-rw-r--r--ui/jquery.ui.droppable.js2
-rw-r--r--ui/jquery.ui.progressbar.js2
-rw-r--r--ui/jquery.ui.resizable.js2
-rw-r--r--ui/jquery.ui.selectable.js2
-rw-r--r--ui/jquery.ui.slider.js2
-rw-r--r--ui/jquery.ui.sortable.js2
-rw-r--r--ui/jquery.ui.tabs.js2
-rw-r--r--ui/jquery.ui.widget.js12
15 files changed, 28 insertions, 28 deletions
diff --git a/demos/autocomplete/combobox.html b/demos/autocomplete/combobox.html
index 88e4105e7..bf2d48bb0 100644
--- a/demos/autocomplete/combobox.html
+++ b/demos/autocomplete/combobox.html
@@ -13,7 +13,7 @@
<script type="text/javascript">
(function($) {
$.widget("ui.combobox", {
- _init: function() {
+ _create: function() {
var self = this;
var select = this.element.hide();
var input = $("<input>")
diff --git a/tests/unit/widget/widget.js b/tests/unit/widget/widget.js
index 3e7d9aaa6..3c870f1fe 100644
--- a/tests/unit/widget/widget.js
+++ b/tests/unit/widget/widget.js
@@ -11,14 +11,14 @@ module('widget factory', {
test('widget creation', function() {
var myPrototype = {
- _init: function() {},
+ _create: function() {},
creationTest: function() {}
};
$.widget('ui.testWidget', myPrototype);
ok($.isFunction($.ui.testWidget), 'constructor was created');
equals('object', typeof $.ui.testWidget.prototype, 'prototype was created');
- equals($.ui.testWidget.prototype._init, myPrototype._init, 'init function is copied over');
+ equals($.ui.testWidget.prototype._create, myPrototype._create, 'create function is copied over');
equals($.ui.testWidget.prototype.creationTest, myPrototype.creationTest, 'random function is copied over');
equals($.ui.testWidget.prototype.option, $.Widget.prototype.option, 'option method copied over from base widget');
});
@@ -30,7 +30,7 @@ test('jQuery usage', function() {
$.widget('ui.testWidget', {
getterSetterVal: 5,
- _init: function() {
+ _create: function() {
ok(shouldInit, 'init called on instantiation');
},
methodWithParams: function(param1, param2) {
@@ -73,7 +73,7 @@ test('direct usage', function() {
$.widget('ui.testWidget', {
getterSetterVal: 5,
- _init: function() {
+ _create: function() {
ok(shouldInit, 'init called on instantiation');
},
methodWithParams: function(param1, param2) {
@@ -113,7 +113,7 @@ test('direct usage', function() {
test('merge multiple option arguments', function() {
expect(1);
$.widget("ui.testWidget", {
- _init: function() {
+ _create: function() {
same(this.options, {
disabled: false,
option1: "value1",
@@ -148,7 +148,7 @@ test('merge multiple option arguments', function() {
test(".widget() - base", function() {
$.widget("ui.testWidget", {
- _init: function() {}
+ _create: function() {}
});
var div = $("<div></div>").testWidget()
same(div[0], div.testWidget("widget")[0]);
@@ -157,7 +157,7 @@ test(".widget() - base", function() {
test(".widget() - overriden", function() {
var wrapper = $("<div></div>");
$.widget("ui.testWidget", {
- _init: function() {},
+ _create: function() {},
widget: function() {
return wrapper;
}
diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js
index 885174c8a..cae2eef39 100644
--- a/ui/jquery.ui.accordion.js
+++ b/ui/jquery.ui.accordion.js
@@ -32,7 +32,7 @@ $.widget("ui.accordion", {
return this.href.toLowerCase() == location.href.toLowerCase();
}
},
- _init: function() {
+ _create: function() {
var o = this.options, self = this;
this.running = 0;
diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js
index 3a6c5607c..27d9ee7d6 100644
--- a/ui/jquery.ui.autocomplete.js
+++ b/ui/jquery.ui.autocomplete.js
@@ -18,7 +18,7 @@ $.widget("ui.autocomplete", {
minLength: 1,
delay: 300
},
- _init: function() {
+ _create: function() {
var self = this;
this.element
.addClass("ui-autocomplete ui-widget ui-widget-content ui-corner-all")
@@ -296,7 +296,7 @@ $.extend($.ui.autocomplete, {
(function($) {
$.widget("ui.menu", {
- _init: function() {
+ _create: function() {
var self = this;
this.element
.addClass("ui-menu ui-widget ui-widget-content ui-corner-all")
diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js
index f104f890d..1b6442975 100644
--- a/ui/jquery.ui.button.js
+++ b/ui/jquery.ui.button.js
@@ -27,7 +27,7 @@ $.widget("ui.button", {
secondary: null
}
},
- _init: function() {
+ _create: function() {
this._determineButtonType();
this.hasTitle = !!this.buttonElement.attr('title');
@@ -208,7 +208,7 @@ $.widget("ui.button", {
});
$.widget("ui.buttonset", {
- _init: function() {
+ _create: function() {
this.element.addClass("ui-button-set");
this.buttons = this.element.find(':button, :submit, :reset, :checkbox, :radio, a, .ui-button')
.button()
diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js
index 15cbf40f7..c84e10cd0 100644
--- a/ui/jquery.ui.dialog.js
+++ b/ui/jquery.ui.dialog.js
@@ -48,7 +48,7 @@ $.widget("ui.dialog", {
width: 300,
zIndex: 1000
},
- _init: function() {
+ _create: function() {
this.originalTitle = this.element.attr('title');
var self = this,
diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js
index fcbf328db..3251a9ebd 100644
--- a/ui/jquery.ui.draggable.js
+++ b/ui/jquery.ui.draggable.js
@@ -41,7 +41,7 @@ $.widget("ui.draggable", $.ui.mouse, {
stack: false,
zIndex: false
},
- _init: function() {
+ _create: function() {
if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position")))
this.element[0].style.position = 'relative';
diff --git a/ui/jquery.ui.droppable.js b/ui/jquery.ui.droppable.js
index 3c8c88b96..59b75dc8c 100644
--- a/ui/jquery.ui.droppable.js
+++ b/ui/jquery.ui.droppable.js
@@ -26,7 +26,7 @@ $.widget("ui.droppable", {
scope: 'default',
tolerance: 'intersect'
},
- _init: function() {
+ _create: function() {
var o = this.options, accept = o.accept;
this.isover = 0; this.isout = 1;
diff --git a/ui/jquery.ui.progressbar.js b/ui/jquery.ui.progressbar.js
index b5898c504..9f42d0bd0 100644
--- a/ui/jquery.ui.progressbar.js
+++ b/ui/jquery.ui.progressbar.js
@@ -17,7 +17,7 @@ $.widget("ui.progressbar", {
options: {
value: 0
},
- _init: function() {
+ _create: function() {
this.element
.addClass("ui-progressbar"
diff --git a/ui/jquery.ui.resizable.js b/ui/jquery.ui.resizable.js
index d93e07948..8d9572fde 100644
--- a/ui/jquery.ui.resizable.js
+++ b/ui/jquery.ui.resizable.js
@@ -33,7 +33,7 @@ $.widget("ui.resizable", $.ui.mouse, {
minWidth: 10,
zIndex: 1000
},
- _init: function() {
+ _create: function() {
var self = this, o = this.options;
this.element.addClass("ui-resizable");
diff --git a/ui/jquery.ui.selectable.js b/ui/jquery.ui.selectable.js
index 596ca4641..f9c31f2d4 100644
--- a/ui/jquery.ui.selectable.js
+++ b/ui/jquery.ui.selectable.js
@@ -22,7 +22,7 @@ $.widget("ui.selectable", $.ui.mouse, {
filter: '*',
tolerance: 'touch'
},
- _init: function() {
+ _create: function() {
var self = this;
this.element.addClass("ui-selectable");
diff --git a/ui/jquery.ui.slider.js b/ui/jquery.ui.slider.js
index ffd0f8475..cc233100b 100644
--- a/ui/jquery.ui.slider.js
+++ b/ui/jquery.ui.slider.js
@@ -31,7 +31,7 @@ $.widget("ui.slider", $.ui.mouse, {
value: 0,
values: null
},
- _init: function() {
+ _create: function() {
var self = this, o = this.options;
this._keySliding = false;
diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js
index 663eddd79..23252931d 100644
--- a/ui/jquery.ui.sortable.js
+++ b/ui/jquery.ui.sortable.js
@@ -39,7 +39,7 @@ $.widget("ui.sortable", $.ui.mouse, {
tolerance: "intersect",
zIndex: 1000
},
- _init: function() {
+ _create: function() {
var o = this.options;
this.containerCache = {};
diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js
index b3c823026..d315a10e8 100644
--- a/ui/jquery.ui.tabs.js
+++ b/ui/jquery.ui.tabs.js
@@ -36,7 +36,7 @@ $.widget("ui.tabs", {
spinner: '<em>Loading&#8230;</em>',
tabTemplate: '<li><a href="#{href}"><span>#{label}</span></a></li>'
},
- _init: function() {
+ _create: function() {
this._tabify(true);
},
diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js
index e1dac2f66..4cc7fba7a 100644
--- a/ui/jquery.ui.widget.js
+++ b/ui/jquery.ui.widget.js
@@ -39,7 +39,7 @@ $.widget = function(name, base, prototype) {
$[namespace] = $[namespace] || {};
$[namespace][name] = function(options, element) {
// allow instantiation without initializing for simple inheritance
- (arguments.length && this._widgetInit(options, element));
+ (arguments.length && this._createWidget(options, element));
};
var basePrototype = new base();
@@ -99,7 +99,7 @@ $.widget.bridge = function(name, object) {
$.Widget = function(options, element) {
// allow instantiation without initializing for simple inheritance
- (arguments.length && this._widgetInit(options, element));
+ (arguments.length && this._createWidget(options, element));
};
$.Widget.prototype = {
@@ -108,9 +108,9 @@ $.Widget.prototype = {
options: {
disabled: false
},
- _widgetInit: function(options, element) {
+ _createWidget: function(options, element) {
// $.widget.bridge stores the plugin instance, but we do it anyway
- // so that it's stored even before the _init function runs
+ // so that it's stored even before the _create function runs
this.element = $(element).data(this.widgetName, this);
this.options = $.extend(true, {},
this.options,
@@ -119,13 +119,13 @@ $.Widget.prototype = {
$.metadata && $.metadata.get(element)[this.widgetName],
options);
- // TODO: use bind's scope option when moving to jQuery 1.4
var self = this;
this.element.bind('remove.' + this.widgetName, function() {
self.destroy();
});
- (this._init && this._init(options, element));
+ (this._create && this._create(options, element));
+ (this._init && this._init());
},
destroy: function() {