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);