From eeb6fdd9d0356836e086813e6efe59009848d5ad Mon Sep 17 00:00:00 2001 From: walljm Date: Fri, 19 Apr 2013 17:07:04 -0400 Subject: [PATCH] - fixed window resize issue cause by loading results --- Android/DynamicBible/assets/js/main.js | 20 +++++++++----------- js/main.js | 22 +++++++++++----------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/Android/DynamicBible/assets/js/main.js b/Android/DynamicBible/assets/js/main.js index 4555a4ac..ec3fa05d 100644 --- a/Android/DynamicBible/assets/js/main.js +++ b/Android/DynamicBible/assets/js/main.js @@ -41,13 +41,6 @@ require(["jquery", "db", "common", "reference", "jquery.cookie", "jquery.ui"], common.Settings.ChangeResultFont($("#changefont").val()); return false; }); - $(window).bind("resize", function() - { - $("#searchresults").css("height", window.innerHeight - 200); - return false; - }); - - $("#searchresults").css("height", window.innerHeight - 200); $("#result").sortable({ handle: ".p-handle" @@ -66,8 +59,13 @@ require(["jquery", "db", "common", "reference", "jquery.cookie", "jquery.ui"], common.Settings.Load(); } - - - - }); + // you need to do this last, otherwise the settings load resets the window height. + $(window).bind("resize", function() + { + $("#searchresults").css("height", window.innerHeight - 200); + return false; + }); + + $("#searchresults").css("height", window.innerHeight - 200); + }); }); diff --git a/js/main.js b/js/main.js index 4555a4ac..82f36b28 100644 --- a/js/main.js +++ b/js/main.js @@ -41,13 +41,6 @@ require(["jquery", "db", "common", "reference", "jquery.cookie", "jquery.ui"], common.Settings.ChangeResultFont($("#changefont").val()); return false; }); - $(window).bind("resize", function() - { - $("#searchresults").css("height", window.innerHeight - 200); - return false; - }); - - $("#searchresults").css("height", window.innerHeight - 200); $("#result").sortable({ handle: ".p-handle" @@ -66,8 +59,15 @@ require(["jquery", "db", "common", "reference", "jquery.cookie", "jquery.ui"], common.Settings.Load(); } - - - - }); + // you need to do this last, otherwise the settings load resets the window height. + $(window).bind("resize", function() + { + $("#searchresults").css("height", window.innerHeight - 200); + return false; + }); + + $("#searchresults").css("height", window.innerHeight - 200); + }); }); + + \ No newline at end of file