From e77406861ace777f917c072b05d84b066155f383 Mon Sep 17 00:00:00 2001 From: Buu Nguyen Date: Wed, 21 May 2014 17:33:37 -0700 Subject: [PATCH] Minor change to popup verbiage and style --- src/inject.css | 3 ++- src/inject.js | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/inject.css b/src/inject.css index 929834f..3959126 100755 --- a/src/inject.css +++ b/src/inject.css @@ -210,7 +210,7 @@ html { top: 40px; left: 5px; z-index: 999993; - width: 250px; + width: 260px; text-align: left; background-color: #fff; background-clip: padding-box; @@ -248,4 +248,5 @@ html { .octotree_popup > .content { padding: 9px 14px; + font-size: 13px; } \ No newline at end of file diff --git a/src/inject.js b/src/inject.js index 63699db..082f7fb 100755 --- a/src/inject.js +++ b/src/inject.js @@ -44,7 +44,7 @@ '' + '
' + '
' + - '
Octotree is hidden by default, click this button or press ⌘ b (or ctrl b) to toggle.
' + + '
Octotree is activated on GitHub code page. Click this button or press ⌘ b (or ctrl b) to show the code tree.
' + '
' + '
') , $sidebar = $dom.find('.octotree_sidebar') @@ -53,8 +53,9 @@ , $toggleBtn = $dom.find('.octotree_toggle') , $helpPopup = $dom.find('.octotree_popup') , $dummyDiv = $('
') - , store = new Storage() - , currentRepo = false + , store = new Storage() + , currentRepo = false + , showingPopup = false $(document).ready(function() { @@ -368,6 +369,7 @@ function showHelpPopup() { if (!store.get(STORE_POPUP)) { + showingPopup = true // TODO: move to domain-agnostic storage store.set(STORE_POPUP, true) $helpPopup @@ -375,11 +377,13 @@ .delay(1000) // delay a bit seems nicer .fadeIn('slow') .click(hideHelpPopup) - setTimeout(hideHelpPopup, 8000) + setTimeout(hideHelpPopup, 15000) } } function hideHelpPopup() { + if (!showingPopup) return + showingPopup = false $helpPopup.fadeOut(function() { $helpPopup.remove() })