Permalink
Browse files

Replacement for "Register" plugin, a "ux" widget factory

  • Loading branch information...
1 parent 8ccb73e commit 5e2692f0f68c03b2d3a12be72c23db3726b4a4e0 @threedubmedia committed Apr 21, 2009
Showing with 7 additions and 4 deletions.
  1. +7 −4 ux/jquery.ux.js
View
@@ -60,9 +60,12 @@ $.ux = function( name, config ){
};
// Plugin instance methods
- Plugin.prototype = config.methods || {};
- Plugin.destroy = function(){
- var self = this, elem;
+ Plugin.prototype = $.extend({
+ destroy: function(){
+ Plugin.destroy( this );
+ }
+ }, config.methods || {});
+ Plugin.destroy = function( self, elem ){
// custom destroy function...
if ( config.destroy )
config.destroy.apply( self, arguments );
@@ -103,7 +106,7 @@ $.ux.all = function( method, args ){
$.each( $.ux.cache, function( i, Plugin ){
if ( Plugin && Plugin.allowed[ method ] )
$.each( Plugin.cache, function( j, cached ){
- if ( cached && cache.instance )
+ if ( cached && cached.instance )
cached.instance[ method ].apply( cached.instance, args );
});
});

0 comments on commit 5e2692f

Please sign in to comment.