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

Unified Diff: chrome/browser/resources/file_manager/foreground/js/ui/progress_center_panel.js

Issue 131403003: Files.app: Show drive sync state in the progress center. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed. Created 6 years, 11 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
Index: chrome/browser/resources/file_manager/foreground/js/ui/progress_center_panel.js
diff --git a/chrome/browser/resources/file_manager/foreground/js/ui/progress_center_panel.js b/chrome/browser/resources/file_manager/foreground/js/ui/progress_center_panel.js
index 988b12e760027cc97042e0317c79f16cb1713af2..69cbc25b4d3f7b719a4b3aa028787c60daf15116 100644
--- a/chrome/browser/resources/file_manager/foreground/js/ui/progress_center_panel.js
+++ b/chrome/browser/resources/file_manager/foreground/js/ui/progress_center_panel.js
@@ -20,18 +20,22 @@ function ProgressCenterItemElement(document) {
progressBar.className = 'progress-bar';
progressBar.appendChild(progressBarIndicator);
+ var progressFrame = document.createElement('div');
+ progressFrame.className = 'progress-frame';
+ progressFrame.appendChild(label);
+ progressFrame.appendChild(progressBar);
+
var cancelButton = document.createElement('button');
cancelButton.className = 'cancel';
cancelButton.setAttribute('tabindex', '-1');
- var progressFrame = document.createElement('div');
- progressFrame.className = 'progress-frame';
- progressFrame.appendChild(progressBar);
- progressFrame.appendChild(cancelButton);
+ var buttonFrame = document.createElement('div');
+ buttonFrame.className = 'button-frame';
+ buttonFrame.appendChild(cancelButton);
var itemElement = document.createElement('li');
- itemElement.appendChild(label);
itemElement.appendChild(progressFrame);
+ itemElement.appendChild(buttonFrame);
return ProgressCenterItemElement.decorate(itemElement);
}
@@ -431,10 +435,8 @@ ProgressCenterPanel.prototype.onToggleAnimationEnd_ = function(event) {
*/
ProgressCenterPanel.prototype.onClick_ = function(event) {
// Toggle button.
- if (event.target.classList.contains('toggle') &&
- (!this.closeView_.classList.contains('single') ||
- this.element_.classList.contains('opened'))) {
-
+ if (event.target.classList.contains('open') ||
+ event.target.classList.contains('close')) {
// If the progress center has already animated, just return.
if (this.element_.classList.contains('animated'))
return;
@@ -459,10 +461,11 @@ ProgressCenterPanel.prototype.onClick_ = function(event) {
}
// Cancel button.
- if (this.cancelCallback) {
- var id = event.target.classList.contains('toggle') ?
- this.closeView_.getAttribute('data-progress-id') :
- event.target.parentNode.parentNode.getAttribute('data-progress-id');
- this.cancelCallback(id);
+ if (event.target.classList.contains('cancel')) {
+ var itemElement = event.target.parentNode.parentNode;
+ if (this.cancelCallback) {
+ var id = itemElement.getAttribute('data-progress-id');
+ this.cancelCallback(id);
+ }
}
};

Powered by Google App Engine
This is Rietveld 408576698