Created
December 20, 2016 09:05
-
-
Save rexboy7/96005a6e338dc7df1e5f2f47f91ae8d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/browser/components/downloads/content/indicator.js b/browser/components/downloads/content/indicator.js | |
index 4c22a6e..3fc3176 100644 | |
--- a/browser/components/downloads/content/indicator.js | |
+++ b/browser/components/downloads/content/indicator.js | |
@@ -284,6 +284,8 @@ const DownloadsIndicatorView = { | |
*/ | |
_notificationTimeout: null, | |
+ _anchorNotificationTimeout: null, | |
+ | |
/** | |
* Check if the panel containing aNode is open. | |
* @param aNode | |
@@ -340,6 +342,10 @@ const DownloadsIndicatorView = { | |
clearTimeout(this._notificationTimeout); | |
} | |
+ if (this._anchorNotificationTimeout) { | |
+ clearTimeout(this._anchorNotificationTimeout); | |
+ } | |
+ | |
// The notification element is positioned to show in the same location as | |
// the downloads button. It's not in the downloads button itself in order to | |
// be able to anchor the notification elsewhere if required, and to ensure | |
@@ -362,6 +368,11 @@ const DownloadsIndicatorView = { | |
notifier.removeAttribute("notification"); | |
notifier.style.transform = ''; | |
}, 1000); | |
+ | |
+ anchor.setAttribute("notification", aType); | |
+ this._anchorNotificationTimeout = setTimeout(() => { | |
+ anchor.removeAttribute("notification"); | |
+ }, 3000); | |
}, | |
////////////////////////////////////////////////////////////////////////////// | |
diff --git a/browser/themes/linux/downloads/indicator.css b/browser/themes/linux/downloads/indicator.css | |
index 6e9d9ac..1331b16 100644 | |
--- a/browser/themes/linux/downloads/indicator.css | |
+++ b/browser/themes/linux/downloads/indicator.css | |
@@ -2,6 +2,8 @@ | |
* License, v. 2.0. If a copy of the MPL was not distributed with this | |
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | |
+%include ../../shared/downloads/indicator.inc.css | |
+ | |
/*** Status and progress indicator ***/ | |
#downloads-animation-container { | |
diff --git a/browser/themes/osx/downloads/indicator.css b/browser/themes/osx/downloads/indicator.css | |
index eb88f07..f0f94a2 100644 | |
--- a/browser/themes/osx/downloads/indicator.css | |
+++ b/browser/themes/osx/downloads/indicator.css | |
@@ -2,6 +2,8 @@ | |
* License, v. 2.0. If a copy of the MPL was not distributed with this | |
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | |
+%include ../../shared/downloads/indicator.inc.css | |
+ | |
/*** Status and progress indicator ***/ | |
#downloads-indicator-anchor { | |
diff --git a/browser/themes/shared/downloads/indicator.inc.css b/browser/themes/shared/downloads/indicator.inc.css | |
new file mode 100644 | |
index 0000000..9874773 | |
--- /dev/null | |
+++ b/browser/themes/shared/downloads/indicator.inc.css | |
@@ -0,0 +1,24 @@ | |
+/* This Source Code Form is subject to the terms of the Mozilla Public | |
+ * License, v. 2.0. If a copy of the MPL was not distributed with this | |
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | |
+ | |
+@keyframes downloadsIndicatorStartJump { | |
+ 0% { | |
+ transform: translateY(0); | |
+ animation-timing-function: ease-out; | |
+ } | |
+ 50% { | |
+ transform: translateY(-3px); | |
+ animation-timing-function: ease-in; | |
+ } | |
+ 100% { | |
+ transform: translateY(0); | |
+ } | |
+} | |
+ | |
+#downloads-button[notification="start"] > #downloads-indicator-anchor { | |
+ animation-name: downloadsIndicatorStartJump; | |
+ animation-duration: 0.5s; | |
+ animation-delay: 1s; | |
+ animation-iteration-count: 2; | |
+} | |
diff --git a/browser/themes/windows/downloads/indicator.css b/browser/themes/windows/downloads/indicator.css | |
index 6272650..edfcd17 100644 | |
--- a/browser/themes/windows/downloads/indicator.css | |
+++ b/browser/themes/windows/downloads/indicator.css | |
@@ -2,6 +2,8 @@ | |
* License, v. 2.0. If a copy of the MPL was not distributed with this | |
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | |
+%include ../../shared/downloads/indicator.inc.css | |
+ | |
/*** Status and progress indicator ***/ | |
#downloads-animation-container { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment