Fix: Resize event handler does not get cleared from window object,by wrong usage of jQuery api.

An handler get added each time a topic is loaded to the window object

jQuery resize api only pass data to the handler when triggered.
```.resize( [eventData ], handler ) ```

The unbind followed in willDestroyElement had no affect. 

.on(...) or bind(..) support the event.namespace

fix was not tested.
This commit is contained in:
lidlanca 2015-01-30 01:57:44 -05:00
parent 52bc03b5e6
commit b4f1ffd4ea
1 changed files with 1 additions and 1 deletions

View File

@ -40,7 +40,7 @@ var TopicView = Discourse.View.extend(AddCategoryClass, Discourse.Scrolling, {
this.bindScrolling({name: 'topic-view'});
var self = this;
$(window).resize('resize.discourse-on-scroll', function() {
$(window).on('resize.discourse-on-scroll', function() {
self.scrolled();
});