diff --git a/src/background.js b/src/background.js index 7829414ded..4f9ec73131 100644 --- a/src/background.js +++ b/src/background.js @@ -75,6 +75,9 @@ chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) { else if (msg.command === 'bgCloseNotificationBar') { messageTab(sender.tab.id, 'closeNotificationBar'); } + else if (msg.command === 'bgAdjustNotificationBar') { + messageTab(sender.tab.id, 'adjustNotificationBar', msg.data); + } else if (msg.command === 'bgCollectPageDetails') { collectPageDetailsForContentScript(sender.tab, msg.sender); } diff --git a/src/content/notificationBar.js b/src/content/notificationBar.js index 5370f951b5..5edda51ea5 100644 --- a/src/content/notificationBar.js +++ b/src/content/notificationBar.js @@ -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; + } + } }); diff --git a/src/notification/bar.css b/src/notification/bar.css index 95e384fbf7..7770f58142 100644 --- a/src/notification/bar.css +++ b/src/notification/bar.css @@ -79,3 +79,13 @@ button.link { background: none; text-decoration: underline; } + +.add-buttons { + width: 175px; +} + +@media (min-width: 768px) { + .add-buttons { + width: 320px; + } +} diff --git a/src/notification/bar.html b/src/notification/bar.html index 4319643943..b824f019ca 100644 --- a/src/notification/bar.html +++ b/src/notification/bar.html @@ -28,7 +28,7 @@