[WRT] Fix overlaped icons issue 31/156331/4
authorSanghyup Lee <sh53.lee@samsung.com>
Wed, 18 Oct 2017 05:45:51 +0000 (14:45 +0900)
committerSanghyup Lee <sh53.lee@samsung.com>
Wed, 18 Oct 2017 08:32:07 +0000 (17:32 +0900)
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 <sh53.lee@samsung.com>
wrt/wrt_support/sample/launcher/assets/js/launcher.js

index af7961e..eea2fb4 100755 (executable)
@@ -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);