1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

remove trigger create when not needed

This commit is contained in:
Luke Pulverenti 2015-12-08 13:57:59 -05:00
parent 76c2164aeb
commit df4f347fb4
9 changed files with 28 additions and 43 deletions

View file

@ -85,38 +85,23 @@
})(jQuery, this);
(function ($, undefined) {
var $win = $(window), self;
window.addEventListener('popstate', function (event) {
var state = event.state || {};
$.event.special.navigate = self = {
bound: false,
setTimeout(function () {
// TODO a lot of duplication between popstate and hashchange
popstate: function (event) {
var state = event.state || {};
// NOTE we let the current stack unwind because any assignment to
// location.hash will stop the world and run this event handler. By
// doing this we create a similar behavior to hashchange on hash
// assignment
setTimeout(function () {
if (event.historyState) {
$.extend(state, event.historyState);
}
window.dispatchEvent(new CustomEvent("navigate", {
detail: {
state: state,
originalEvent: event
}
}));
}, 0);
if (event.historyState) {
$.extend(state, event.historyState);
}
};
window.addEventListener('popstate', self.popstate);
})(jQuery);
window.dispatchEvent(new CustomEvent("navigate", {
detail: {
state: state,
originalEvent: event
}
}));
}, 0);
});
jQuery.mobile.widgets = {};