1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 15:23:33 +00:00

adjust notification bar for small/zoomed screens

This commit is contained in:
Kyle Spearrin
2017-09-07 10:12:34 -04:00
parent 0b2fa01232
commit 1b344ade0d
5 changed files with 52 additions and 3 deletions

View File

@@ -17,6 +17,11 @@
sendResponse();
return true;
}
else if (msg.command === 'adjustNotificationBar') {
adjustBar(msg.data);
sendResponse();
return true;
}
else if (msg.command === 'pageDetails') {
pageDetails.push(msg.data.details);
watchForms(msg.data.forms);
@@ -249,4 +254,20 @@
break;
}
}
function adjustBar(data) {
if (data.height !== 42) {
var newHeight = data.height + 'px';
doHeightAdjustment('bit-notification-bar-iframe', newHeight);
doHeightAdjustment('bit-notification-bar', newHeight);
doHeightAdjustment('bit-notification-bar-spacer', newHeight);
}
}
function doHeightAdjustment(elId, heightStyle) {
var el = document.getElementById(elId);
if (el) {
el.style.height = heightStyle;
}
}
});