Skip to content

Commit

Permalink
Set the popup window size manually so it is at least manageable
Browse files Browse the repository at this point in the history
  • Loading branch information
cpoppema committed Mar 24, 2016
1 parent a49c188 commit c590584
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
17 changes: 15 additions & 2 deletions code/css/popup.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
body {
padding-top: .9375rem;
padding-bottom: .9375rem;
background-color: #eee;
width: 330px;
height: 100%;
overflow-y: auto;
}

html {
/* firefox only seems to respect this initial value for its panel height */
height: 600px;

max-height: 600px;
overflow-y: hidden;
}

.container {
padding-top: .9375rem;
padding-bottom: .9375rem;
}

.links {
Expand Down
25 changes: 24 additions & 1 deletion code/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

var msg = require('./modules/msg').init('popup');


function autofocus() {
var elem = $('[autofocus]:visible');
if (elem && inViewport(elem.get(0))) {
Expand Down Expand Up @@ -199,10 +198,16 @@
} else {
$(secretElem).hide();
}

// properly size popup
resizeViewport();
});
} else {
// show all
$('.secret').show();

// properly size popup
resizeViewport();
}
}

Expand Down Expand Up @@ -374,6 +379,9 @@
// show element
$(secretElem).show();

// properly size popup
resizeViewport();

if ((i + 1) === secrets.length) {
// end progress
progress.end();
Expand All @@ -391,9 +399,18 @@
}
var noSecretsMessage = $($('#no-secrets-template').html());
noSecretsMessage.appendTo($('#secrets'));

// properly size popup
resizeViewport();
}
}

function resizeViewport() {
$('html').css('height', '');
var height = $('body').outerHeight();
$('html').css('height', height);
}

function restoreLastQuery() {
if (!$('#search').length) {
return;
Expand Down Expand Up @@ -473,6 +490,9 @@
showLogout();
}
});

// properly size popup
resizeViewport();
}

function showUnlock() {
Expand All @@ -484,6 +504,9 @@
$('#unlock-form').show();
var unlockForm = $($('#unlock-form-template').html());
unlockForm.appendTo($('#unlock-form'));

// properly size popup
resizeViewport();
}

function startProgress(elem, reset) {
Expand Down

0 comments on commit c590584

Please sign in to comment.