From: Sanghyup Lee Date: Wed, 18 Oct 2017 05:45:51 +0000 (+0900) Subject: [WRT] Fix overlaped icons issue X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F31%2F156331%2F4;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git [WRT] Fix overlaped icons issue At first launching, desktop size isn't calculated properly. This patch sets desktop size as 800, 533 in this case. Change-Id: Ie19f8c4f025f039ef717bfefa1935f24f852a743 Signed-off-by: Sanghyup Lee --- diff --git a/wrt/wrt_support/sample/launcher/assets/js/launcher.js b/wrt/wrt_support/sample/launcher/assets/js/launcher.js index af7961e..eea2fb4 100755 --- a/wrt/wrt_support/sample/launcher/assets/js/launcher.js +++ b/wrt/wrt_support/sample/launcher/assets/js/launcher.js @@ -266,8 +266,17 @@ $(function() { var html = _.template($(template).html()); self.$el.html(html); self.addWasMenu(); - self.desktop_width = $('.desktop').width() - launcher.webapp_left_start_position * 2; - self.desktop_height = $('.desktop').height() - launcher.webapp_top_start_position * 2; + + // FIXME: Desktop size is miscalculated as (1, 0) at first launching. + desktop_width = $('.desktop').width(); + desktop_height = $('.desktop').height(); + if (desktop_width <= 1) + desktop_width = 800; + if (desktop_height <= 1) + desktop_height = 533; + + self.desktop_width = desktop_width - launcher.webapp_left_start_position * 2; + self.desktop_height = desktop_height - launcher.webapp_top_start_position * 2; self.desktop_max_width_app_num = parseInt(self.desktop_width / (launcher.webapp_width + launcher.webapp_gap)); self.desktop_max_height_app_num = parseInt(self.desktop_height / (launcher.webapp_height + launcher.webapp_gap)); console.log("desktop_width : " + self.desktop_width);