From 063a22709ad069cc99b1df4f1c1533f90b2709fc Mon Sep 17 00:00:00 2001 From: Phil Crosby Date: Fri, 29 Jan 2010 19:52:10 -0800 Subject: Tweak the CSS so you can use link hints to close the "vimium has been upgraded" message. --- vimiumFrontend.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/vimiumFrontend.js b/vimiumFrontend.js index 5e6d323a..6a864cc4 100644 --- a/vimiumFrontend.js +++ b/vimiumFrontend.js @@ -150,6 +150,7 @@ function initializeWhenEnabled() { function initializeOnDomReady() { if (isEnabledForUrl) enterInsertModeIfElementIsFocused(); + // Tell the background page we're in the dom ready state. chrome.extension.connect({ name: "domReady" }); }; @@ -496,12 +497,13 @@ HUD = { "border: 1px solid #b3b3b3;" + "border-radius: 4px 4px 0 0;" + "font-family: Lucida Grande, Arial, Sans;" + - "z-index: 99999999999;" + + // One less than vimium's hint markers, so link hints can be shown e.g. for the panel's close button. + "z-index: 99999998;" + "text-shadow: 0px 1px 2px #FFF;" + "line-height: 1.0;" + "opacity: 0;" + "}" + - ".vimiumHUD a, .vimiumHUD a:hover { color: blue; }" + + ".vimiumHUD a, .vimiumHUD a:hover { background-color: transparent; color: blue; }" + ".vimiumHUD .close-button {" + "font-family:courier new;" + "font-weight:bold;" + @@ -534,13 +536,18 @@ HUD = { showUpgradeNotification: function(version) { HUD.upgradeNotificationElement().innerHTML = "Vimium has been updated to " + "" + - version + "x"; + version + ".x"; var closeLink = HUD.upgradeNotificationElement().getElementsByClassName("close-button")[0]; - closeLink.addEventListener("click", HUD.hideUpgradeNotification, false); + closeLink.addEventListener("click", HUD.onCloseNotificationClick, false); Tween.fade(HUD.upgradeNotificationElement(), 1.0, 150); }, - hideUpgradeNotification: function() { + onCloseNotificationClick: function(event) { + event.preventDefault(); + HUD.hideUpgradeNotification(); + }, + + hideUpgradeNotification: function(clickEvent) { Tween.fade(HUD.upgradeNotificationElement(), 0, 150, function() { HUD.upgradeNotificationElement().style.display = "none"; }); }, -- cgit v1.2.3