Fixed translator backwards compatibility issue

Also removed the _clearMenus global object because populating the global namespace is bad, bad, bad
This commit is contained in:
Peter Jaszkowiak
2015-05-03 23:36:23 -06:00
parent a93a1d720d
commit ad7b561dd4
2 changed files with 26 additions and 22 deletions

View File

@@ -79,25 +79,27 @@ if ('undefined' !== typeof window) {
})(jQuery || {fn:{}});
// FIX FOR #1245 - https://github.com/NodeBB/NodeBB/issues/1245
// from http://stackoverflow.com/questions/15931962/bootstrap-dropdown-disappear-with-right-click-on-firefox
// obtain a reference to the original handler
var _clearMenus = $._data(document, "events").click.filter(function (el) {
return el.namespace === 'bs.data-api.dropdown' && el.selector === undefined;
});
if(_clearMenus.length) {
_clearMenus = _clearMenus[0].handler;
}
// disable the old listener
$(document)
.off('click.data-api.dropdown', _clearMenus)
.on('click.data-api.dropdown', function (e) {
// call the handler only when not right-click
if (e.button !== 2) {
_clearMenus();
}
(function(){
// FIX FOR #1245 - https://github.com/NodeBB/NodeBB/issues/1245
// from http://stackoverflow.com/questions/15931962/bootstrap-dropdown-disappear-with-right-click-on-firefox
// obtain a reference to the original handler
var _clearMenus = $._data(document, "events").click.filter(function (el) {
return el.namespace === 'bs.data-api.dropdown' && el.selector === undefined;
});
if(_clearMenus.length) {
_clearMenus = _clearMenus[0].handler;
}
// disable the old listener
$(document)
.off('click.data-api.dropdown', _clearMenus)
.on('click.data-api.dropdown', function (e) {
// call the handler only when not right-click
if (e.button !== 2) {
_clearMenus();
}
});
})();
}