Skip to content

Commit

Permalink
Replacement for "Register" plugin, a "ux" widget factory
Browse files Browse the repository at this point in the history
  • Loading branch information
threedubmedia committed Apr 21, 2009
1 parent 8ccb73e commit 5e2692f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ux/jquery.ux.js
Expand Up @@ -60,9 +60,12 @@ $.ux = function( name, config ){
}; };


// Plugin instance methods // Plugin instance methods
Plugin.prototype = config.methods || {}; Plugin.prototype = $.extend({
Plugin.destroy = function(){ destroy: function(){
var self = this, elem; Plugin.destroy( this );
}
}, config.methods || {});
Plugin.destroy = function( self, elem ){
// custom destroy function... // custom destroy function...
if ( config.destroy ) if ( config.destroy )
config.destroy.apply( self, arguments ); config.destroy.apply( self, arguments );
Expand Down Expand Up @@ -103,7 +106,7 @@ $.ux.all = function( method, args ){
$.each( $.ux.cache, function( i, Plugin ){ $.each( $.ux.cache, function( i, Plugin ){
if ( Plugin && Plugin.allowed[ method ] ) if ( Plugin && Plugin.allowed[ method ] )
$.each( Plugin.cache, function( j, cached ){ $.each( Plugin.cache, function( j, cached ){
if ( cached && cache.instance ) if ( cached && cached.instance )
cached.instance[ method ].apply( cached.instance, args ); cached.instance[ method ].apply( cached.instance, args );
}); });
}); });
Expand Down

0 comments on commit 5e2692f

Please sign in to comment.