lib/kissy/5.0.0-alpha.3/build/base-debug.js
function (plugin) {
                var plugins = [], self = this, isString = typeof plugin === 'string';
                util.each(self.get('plugins'), function (p) {
                    var keep = 0, pluginId;
                    if (plugin) {
                        if (isString) {
                            // user defined takes priority
                            pluginId = p.get && p.get('pluginId') || p.pluginId;
                            if (pluginId !== plugin) {
                                plugins.push(p);
                                keep = 1;
                            }
                        } else {
                            if (p !== plugin) {
                                plugins.push(p);
                                keep = 1;
                            }
                        }
                    }
                    if (!keep) {
                        p.pluginDestructor(self);
                    }
                });
                self.setInternal('plugins', plugins);
                return self;
            }
function (plugin) {
                var plugins = [], self = this, isString = typeof plugin === 'string';
                util.each(self.get('plugins'), function (p) {
                    var keep = 0, pluginId;
                    if (plugin) {
                        if (isString) {
                            // user defined takes priority
                            pluginId = p.get && p.get('pluginId') || p.pluginId;
                            if (pluginId !== plugin) {
                                plugins.push(p);
                                keep = 1;
                            }
                        } else {
                            if (p !== plugin) {
                                plugins.push(p);
                                keep = 1;
                            }
                        }
                    }
                    if (!keep) {
                        p.pluginDestructor(self);
                    }
                });
                self.setInternal('plugins', plugins);
                return self;
            }
function ( plugin ) { var plugins = [ ] , self = this , isString = typeof plugin === 'string' ; util . each ( self . get ( 'plugins' ) , function ( p ) { var keep = 0 , pluginId ; if ( plugin ) { if ( isString ) { // user defined takes priority pluginId = p . get && p . get ( 'pluginId' ) || p . pluginId ; if ( pluginId !== plugin ) { plugins . push ( p ) ; keep = 1 ; } } else { if ( p !== plugin ) { plugins . push ( p ) ; keep = 1 ; } } } if ( ! keep ) { p . pluginDestructor ( self ) ; } } ) ; self . setInternal ( 'plugins' , plugins ) ; return self ; }
unplug by pluginId or plugin instance.
if called with no parameter, then destroy all plugins.
@param {Object|String} [plugin]
@chainable
unplug by pluginId or plugin instance . if called with no parameter then destroy all plugins .