You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not going to pass a laundry list of selectors to elementQuery, but instead, each of my Backbone Views will be responsible for:
Registering new elementQuery selectors used by the view and calling refresh() by passing true.
Basically, I will be listing the query selectors used for this view like elQueries: ['.elem1', '.elem2']
Just after the view has been rendered into the DOM, I will match the selectors from elQueries to the Grunt generated JSON object to register only selectors needed for a given view.
Unregistering elementQuery selectors that are no longer on the page (ie, when the view closes)
@jpdesigndev sorry to not respond sooner, yes I am open to a PR to unregister a selector. If it adds much file size at all, you might want to write it as a plugin in a separate JS file since I imagine not many people will be unregistering selectors.
Activity
AntonTrollback commentedon May 15, 2014
+1
I hope you share that grunt task :)
tysonmatanich commentedon May 15, 2014
@jpdesigndev sorry to not respond sooner, yes I am open to a PR to unregister a selector. If it adds much file size at all, you might want to write it as a plugin in a separate JS file since I imagine not many people will be unregistering selectors.