diff --git a/README.md b/README.md index fa896c9..9b40961 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,8 @@ feature_set.Feature({ // feature configuration (optional) // NOTE: if not present here this will be taken from .actions.config - // NOTE: this takes priority over .actions.config + // NOTE: this takes priority over .actions.config, it is not recommended + // to define both. config: { option: 'value', // ... diff --git a/features.js b/features.js index 02888ec..e2b9bdf 100755 --- a/features.js +++ b/features.js @@ -161,20 +161,28 @@ module.FeatureProto = { return this }, + + // XXX need to revise this... + // - .mixout(..) is available directly from the object while + // .remove(..) is not... + // - might be a good idea to add a specific lifecycle actions to + // enable feautures to handle their removal correctly... remove: function(actions){ if(this.actions != null){ - actions.mixout(this.actions) + actions.mixout(this.tag || this.actions) } if(this.handlers != null){ actions.off('*', this.tag) } + // XXX if(this.hasOwnProperty('remove') && this.setup !== FeatureProto.remove){ this.remove(actions) } // remove feature DOM elements... + // XXX actions.ribbons.viewer.find('.' + this.tag).remove() return this @@ -1001,6 +1009,13 @@ var FeatureSetProto = { return obj }, + + // XXX revise... + // ...the main problem here is that .mixout(..) is accesible + // directly from actions while the feature .remove(..) method + // is not... + // ...would be nice to expose the API to actions directly or + // keep it only in features... remove: function(obj, lst){ lst = lst.constructor !== Array ? [lst] : lst var that = this