diff --git a/dashboard-ui/cordova/ios/orientation.js b/dashboard-ui/cordova/ios/orientation.js index 89ddea319..02e9910d7 100644 --- a/dashboard-ui/cordova/ios/orientation.js +++ b/dashboard-ui/cordova/ios/orientation.js @@ -7,7 +7,7 @@ // Try to make it react quicker to the orientation change doc.scrollTop(doc.scrollTop() + 1); - $('paper-tabs').filter(':visible').hide().show(); + //$('paper-tabs').filter(':visible').hide().show(); } function onOrientationChange() { @@ -18,6 +18,6 @@ } } - $(window).on('orientationchange', onOrientationChange); + window.addEventListener('orientationchange', onOrientationChange); })(); \ No newline at end of file diff --git a/dashboard-ui/scripts/favorites.js b/dashboard-ui/scripts/favorites.js index 0e3fc7434..2f4dc43bc 100644 --- a/dashboard-ui/scripts/favorites.js +++ b/dashboard-ui/scripts/favorites.js @@ -182,7 +182,7 @@ pageIdOn('pageinit', "indexPage", initHomePage); - pageIdOn('pageshow', "favoritesPage", function () { + pageIdOn('pagebeforeshow', "favoritesPage", function () { var page = this; diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js index 7fb809f8f..2be2b6519 100644 --- a/dashboard-ui/scripts/itemdetailpage.js +++ b/dashboard-ui/scripts/itemdetailpage.js @@ -1231,7 +1231,12 @@ renderThemeSongs(page, themeSongs); renderThemeVideos(page, themeVideos); - $(page).trigger('thememediadownload', [result]); + page.dispatchEvent(new CustomEvent("thememediadownload", { + detail: { + themeMediaResult: result + } + })); + }); } diff --git a/dashboard-ui/scripts/librarymenu.js b/dashboard-ui/scripts/librarymenu.js index 32ffef9ba..5f60631f5 100644 --- a/dashboard-ui/scripts/librarymenu.js +++ b/dashboard-ui/scripts/librarymenu.js @@ -143,6 +143,10 @@ var viewMenuBar = document.querySelector(".viewMenuBar"); initHeadRoom(viewMenuBar); + + viewMenuBar.querySelector('.btnNotifications').addEventListener('click', function () { + Dashboard.navigate('notificationlist.html'); + }); } function getItemHref(item, context) { diff --git a/dashboard-ui/scripts/moviesrecommended.js b/dashboard-ui/scripts/moviesrecommended.js index c0107cd93..4d382b9dc 100644 --- a/dashboard-ui/scripts/moviesrecommended.js +++ b/dashboard-ui/scripts/moviesrecommended.js @@ -347,7 +347,7 @@ }); }); - pageIdOn('pageshow', "moviesPage", function () { + pageIdOn('pagebeforeshow', "moviesPage", function () { var page = this; diff --git a/dashboard-ui/scripts/musicrecommended.js b/dashboard-ui/scripts/musicrecommended.js index c2b1ad669..24a9c9610 100644 --- a/dashboard-ui/scripts/musicrecommended.js +++ b/dashboard-ui/scripts/musicrecommended.js @@ -285,7 +285,7 @@ window.MusicPage.renderSuggestedTab = loadSuggestionsTab; window.MusicPage.initSuggestedTab = initSuggestedTab; - $(document).on('pageinit', "#musicRecommendedPage", function () { + pageIdOn('pageinit', "musicRecommendedPage", function () { var page = this; @@ -306,7 +306,9 @@ loadTab(page, parseInt(e.target.selected)); }); - }).on('pageshow', "#musicRecommendedPage", function () { + }); + + pageIdOn('pagebeforeshow', "musicRecommendedPage", function () { var page = this; diff --git a/dashboard-ui/scripts/notifications.js b/dashboard-ui/scripts/notifications.js index bc51ef2b8..833c9bfcb 100644 --- a/dashboard-ui/scripts/notifications.js +++ b/dashboard-ui/scripts/notifications.js @@ -180,12 +180,6 @@ $(apiClient).off("websocketmessage", onWebSocketMessage).on("websocketmessage", onWebSocketMessage); } - document.addEventListener('headercreated', function () { - $('.btnNotifications').on('click', function () { - Dashboard.navigate('notificationlist.html'); - }); - }); - if (window.ApiClient) { initializeApiClient(window.ApiClient); } diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index 9cd0e7dda..381cb0bc7 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -2231,6 +2231,7 @@ var AppInfo = {}; depends.push('jqmcollapsible'); depends.push('jqmcontrolgroup'); depends.push('jqmcheckbox'); + depends.push('scripts/notifications'); } require(depends, function () { @@ -2324,7 +2325,6 @@ var AppInfo = {}; } postInitDependencies.push('scripts/thememediaplayer'); - postInitDependencies.push('scripts/notifications'); postInitDependencies.push('scripts/remotecontrol'); require(postInitDependencies); diff --git a/dashboard-ui/scripts/thememediaplayer.js b/dashboard-ui/scripts/thememediaplayer.js index ffec42491..e2e4f0db3 100644 --- a/dashboard-ui/scripts/thememediaplayer.js +++ b/dashboard-ui/scripts/thememediaplayer.js @@ -59,12 +59,13 @@ return MediaController.getCurrentPlayer(); } - Events.on(document, 'thememediadownload', function (e, themeMediaResult) { + document.addEventListener('thememediadownload', function (e) { if (!enabled()) { return; } + var themeMediaResult = e.detail.themeMediaResult; var ownerId = themeMediaResult.ThemeSongsResult.OwnerId; if (ownerId != currentOwnerId) { diff --git a/dashboard-ui/thirdparty/jquerymobile-1.4.5/jquery.mobile.custom.js b/dashboard-ui/thirdparty/jquerymobile-1.4.5/jquery.mobile.custom.js index 74d6cf0c3..8d18866c1 100644 --- a/dashboard-ui/thirdparty/jquerymobile-1.4.5/jquery.mobile.custom.js +++ b/dashboard-ui/thirdparty/jquerymobile-1.4.5/jquery.mobile.custom.js @@ -1929,6 +1929,7 @@ dependencies.push('jqmcollapsible'); dependencies.push('jqmcontrolgroup'); dependencies.push('jqmcheckbox'); + dependencies.push('scripts/notifications'); } require(dependencies, function () {