Lack of interest Use namespaces in events for easy unbinding

This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.

CyberAP

Well-known member
Here is some code from xenforo.js:
Code:
$(window).on('resize', function() {
                XenForo.checkQuoteSizing($(document));
            });

Anonymous function was bind to 'resize' event in window. There is no way to unbind this function and save all other functions that were bind to 'resize' event. Here is an easy way to solve this and make developers happy:
Code:
$(window).on('resize.checkQuoteSizing', function() {
                XenForo.checkQuoteSizing($(document));
            });

Now we can unbind this event with a simple call:
Code:
$(window).off('resize.checkQuoteSizing');
 
Upvote 0

CyberAP

Well-known member
Just analyzed some XF 2.0 JS and it still has the same event binding as in XF 1.0. I hope this gets changed in final release, so we can customize event listeners as we want to.
 
Top