From 5f5ed632c86e9ccbb8d8b40159c615113cc2b290 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sat, 17 Jan 2015 18:37:08 +0200 Subject: [PATCH] media browser: fixed layout on small screens --- static/js/main.js | 9 +++++++-- static/js/ui.js | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/static/js/main.js b/static/js/main.js index 4a5a51a..a4f28e0 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -2669,9 +2669,11 @@ function runMediaDialog(cameraId, mediaType) { buttonsDiv.show(); if (windowWidth < 1000) { + mediaListDiv.width(parseInt(windowWidth * 0.8)); + mediaListDiv.height(parseInt(windowHeight * 0.7)); + groupsDiv.width(parseInt(windowWidth * 0.8)); groupsDiv.height(''); groupsDiv.addClass('small-screen'); - mediaListDiv.height(parseInt(windowHeight * 0.7)); } else { mediaListDiv.width(parseInt(windowWidth * 0.7)); @@ -2756,7 +2758,10 @@ function runMediaDialog(cameraId, mediaType) { } var title; - if (mediaType === 'picture') { + if ($(window).width() < 1000) { + title = data.cameraName; + } + else if (mediaType === 'picture') { title = 'Pictures taken by ' + data.cameraName; } else { diff --git a/static/js/ui.js b/static/js/ui.js index 1f711fa..19eaa23 100644 --- a/static/js/ui.js +++ b/static/js/ui.js @@ -715,8 +715,8 @@ function updateModalDialogPosition() { /* repeat the operation multiple times, the size might change */ for (i = 0; i < 3; i++) { - modalWidth = container.outerWidth() + 10 /* the margins */; - modalHeight = container.outerHeight() + 10 /* the margins */; + modalWidth = container.outerWidth(); + modalHeight = container.outerHeight(); container.css('left', Math.floor((windowWidth - modalWidth) / 2)); container.css('top', Math.floor((windowHeight - modalHeight) / 2)); -- 2.39.5