Skip to content
Permalink
Browse files

Widget factory: Fixed $4266 - Add custom selectors for widgets.

  • Loading branch information
scottgonzalez committed Mar 28, 2009
1 parent 2b8109e commit 12b47dc1ea6dfa8c21d2705d02332646e4ff5770
Showing with 9 additions and 2 deletions.
  1. +9 −2 ui/ui.core.js
@@ -217,9 +217,16 @@ function getter(namespace, plugin, method, args) {
}

$.widget = function(name, prototype) {
var namespace = name.split(".")[0];
var namespace = name.split(".")[0],
fullName;
name = name.split(".")[1];
fullName = namespace + '-' + name;

// create selector for plugin
$.expr[':'][fullName] = function(elem) {
return !!$.data(elem, name);
};

// create plugin method
$.fn[name] = function(options) {
var isMethodCall = (typeof options == 'string'),
@@ -259,7 +266,7 @@ $.widget = function(name, prototype) {
this.namespace = namespace;
this.widgetName = name;
this.widgetEventPrefix = $[namespace][name].eventPrefix || name;
this.widgetBaseClass = namespace + '-' + name;
this.widgetBaseClass = fullName;

this.options = $.extend(true, {},
$.widget.defaults,

0 comments on commit 12b47dc

Please sign in to comment.
You can’t perform that action at this time.