From 538ff65a6ec959263c815f5a377a2bba9e929f9f Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 6 Apr 2013 14:57:38 -0400 Subject: [PATCH] use pagebeforeshow when possible to remove transitional flicker --- dashboard-ui/scripts/boxsets.js | 6 ++++-- dashboard-ui/scripts/indexpage.js | 2 +- dashboard-ui/scripts/movies.js | 5 ++++- dashboard-ui/scripts/moviesrecommended.js | 2 +- dashboard-ui/scripts/tvrecommended.js | 2 +- dashboard-ui/scripts/tvshows.js | 6 ++++-- 6 files changed, 15 insertions(+), 8 deletions(-) diff --git a/dashboard-ui/scripts/boxsets.js b/dashboard-ui/scripts/boxsets.js index 84e0871fc1..28ab752e3a 100644 --- a/dashboard-ui/scripts/boxsets.js +++ b/dashboard-ui/scripts/boxsets.js @@ -58,9 +58,11 @@ reloadItems(page); }); - }).on('pageshow', "#boxsetsPage", function () { + }).on('pagebeforeshow', "#boxsetsPage", function () { - reloadItems(this); + reloadItems(this); + + }).on('pageshow', "#boxsetsPage", function () { // Reset form values using the last used query $('.radioSortBy', this).each(function () { diff --git a/dashboard-ui/scripts/indexpage.js b/dashboard-ui/scripts/indexpage.js index f00682877d..08b5601650 100644 --- a/dashboard-ui/scripts/indexpage.js +++ b/dashboard-ui/scripts/indexpage.js @@ -13,7 +13,7 @@ return html; } - $(document).on('pageshow', "#indexPage", function () { + $(document).on('pagebeforeshow', "#indexPage", function () { var page = this; diff --git a/dashboard-ui/scripts/movies.js b/dashboard-ui/scripts/movies.js index 01ba19a99e..64f85c1418 100644 --- a/dashboard-ui/scripts/movies.js +++ b/dashboard-ui/scripts/movies.js @@ -191,9 +191,12 @@ reloadItems(page); }); + }).on('pagebeforeshow', "#moviesPage", function() { + + reloadItems(this); + }).on('pageshow', "#moviesPage", function () { - reloadItems(this); // Reset form values using the last used query $('.radioSortBy', this).each(function () { diff --git a/dashboard-ui/scripts/moviesrecommended.js b/dashboard-ui/scripts/moviesrecommended.js index cfdf4abdf0..0c894c621c 100644 --- a/dashboard-ui/scripts/moviesrecommended.js +++ b/dashboard-ui/scripts/moviesrecommended.js @@ -1,6 +1,6 @@ (function ($, document) { - $(document).on('pageshow', "#moviesRecommendedPage", function () { + $(document).on('pagebeforeshow', "#moviesRecommendedPage", function () { var page = this; diff --git a/dashboard-ui/scripts/tvrecommended.js b/dashboard-ui/scripts/tvrecommended.js index 6c4d342230..31a583b0e8 100644 --- a/dashboard-ui/scripts/tvrecommended.js +++ b/dashboard-ui/scripts/tvrecommended.js @@ -1,6 +1,6 @@ (function ($, document) { - $(document).on('pageshow', "#tvRecommendedPage", function () { + $(document).on('pagebeforeshow', "#tvRecommendedPage", function () { var page = this; diff --git a/dashboard-ui/scripts/tvshows.js b/dashboard-ui/scripts/tvshows.js index 396c97e3dc..0e637014ab 100644 --- a/dashboard-ui/scripts/tvshows.js +++ b/dashboard-ui/scripts/tvshows.js @@ -127,9 +127,11 @@ reloadItems(page); }); - }).on('pageshow', "#tvShowsPage", function () { + }).on('pagebeforeshow', "#tvShowsPage", function () { - reloadItems(this); + reloadItems(this); + + }).on('pageshow', "#tvShowsPage", function () { // Reset form values using the last used query $('.radioSortBy', this).each(function () {