Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7072)

Unified Diff: chrome/browser/resources/shared/js/cr/ui/overlay.js

Issue 9625006: Implement new overlay style for options pages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with master. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/shared/css/overlay.css ('k') | chrome/browser/resources/shared_resources.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/shared/js/cr/ui/overlay.js
diff --git a/chrome/browser/resources/shared/js/cr/ui/overlay.js b/chrome/browser/resources/shared/js/cr/ui/overlay.js
index c2b2fffe955439f70914e9170982a481ce5784b7..5ebec4a9fbc121869eff6a4f0f8ed9420d95ebc8 100644
--- a/chrome/browser/resources/shared/js/cr/ui/overlay.js
+++ b/chrome/browser/resources/shared/js/cr/ui/overlay.js
@@ -51,10 +51,18 @@ cr.define('cr.ui.overlay', function() {
* @param {HTMLElement} overlay The .overlay.
*/
function setupOverlay(overlay) {
- /* Remove the 'shake' animation any time the overlay is hidden or shown.
+ // Close the overlay on clicking any of the pages' close buttons.
+ var closeButtons = overlay.querySelectorAll('.page .close-button');
+ for (var i = 0; i < closeButtons.length; i++) {
+ closeButtons[i].addEventListener('click', function(e) {
+ cr.dispatchSimpleEvent(overlay, 'cancelOverlay');
+ });
+ }
+
+ /* Remove the 'pulse' animation any time the overlay is hidden or shown.
*/
overlay.__defineSetter__('hidden', function(value) {
- this.classList.remove('shake');
+ this.classList.remove('pulse');
if (value)
this.setAttribute('hidden', true);
else
@@ -66,17 +74,17 @@ cr.define('cr.ui.overlay', function() {
/* Shake when the user clicks away. */
overlay.addEventListener('click', function(e) {
- // Only shake if the overlay was the target of the click.
+ // Only pulse if the overlay was the target of the click.
if (this != e.target)
return;
// This may be null while the overlay is closing.
var overlayPage = this.querySelector('.page:not([hidden])');
if (overlayPage)
- overlayPage.classList.add('shake');
+ overlayPage.classList.add('pulse');
});
overlay.addEventListener('webkitAnimationEnd', function(e) {
- e.target.classList.remove('shake');
+ e.target.classList.remove('pulse');
});
}
« no previous file with comments | « chrome/browser/resources/shared/css/overlay.css ('k') | chrome/browser/resources/shared_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698