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

Unified Diff: ui/file_manager/file_manager/foreground/js/ui/file_manager_ui.js

Issue 640223006: Files.app: Make DialogFooter UI class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 6 years, 2 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: ui/file_manager/file_manager/foreground/js/ui/file_manager_ui.js
diff --git a/ui/file_manager/file_manager/foreground/js/ui/file_manager_ui.js b/ui/file_manager/file_manager/foreground/js/ui/file_manager_ui.js
index b06b473e2f9388174391c6af2e703cc4f9431096..3e25139785c73f615d3f29ccc1394ba5cc11499e 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/file_manager_ui.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/file_manager_ui.js
@@ -105,22 +105,10 @@ function FileManagerUI(element, dialogType) {
this.toggleViewButton = null;
/**
- * File type selector in the footer.
- * @type {HTMLSelectElement}
+ * Dialog footer.
+ * @type {DialogFooter}
*/
- this.fileTypeSelector = null;
-
- /**
- * OK button in the footer.
- * @type {HTMLButtonElement}
- */
- this.okButton = null;
-
- /**
- * Cancel button in the footer.
- * @type {HTMLButtonElement}
- */
- this.cancelButton = null;
+ this.dialogFooter = null;
Object.seal(this);
@@ -143,44 +131,10 @@ function FileManagerUI(element, dialogType) {
*/
FileManagerUI.prototype.initDialogType_ = function() {
// Obtain elements.
- var hasFooterPanel =
- this.dialogType_ == DialogType.SELECT_SAVEAS_FILE;
-
- // If the footer panel exists, the buttons are placed there. Otherwise,
- // the buttons are on the preview panel.
- var parentPanelOfButtons = this.element_.ownerDocument.querySelector(
- !hasFooterPanel ? '.preview-panel' : '.dialog-footer');
- parentPanelOfButtons.classList.add('button-panel');
- this.fileTypeSelector = /** @type {!HTMLSelectElement} */
- (parentPanelOfButtons.querySelector('.file-type'));
- this.okButton = /** @type {!HTMLButtonElement} */
- (parentPanelOfButtons.querySelector('.ok'));
- this.cancelButton = /** @type {!HTMLButtonElement} */
- (parentPanelOfButtons.querySelector('.cancel'));
+ this.dialogFooter = DialogFooter.findDialogFooter(
+ this.dialogType_, /** @type {!Document} */(this.element_.ownerDocument));
// Set attributes.
- var okLabel = str('OPEN_LABEL');
-
- switch (this.dialogType_) {
- case DialogType.SELECT_UPLOAD_FOLDER:
- okLabel = str('UPLOAD_LABEL');
- break;
-
- case DialogType.SELECT_SAVEAS_FILE:
- okLabel = str('SAVE_LABEL');
- break;
-
- case DialogType.SELECT_FOLDER:
- case DialogType.SELECT_OPEN_FILE:
- case DialogType.SELECT_OPEN_MULTI_FILE:
- case DialogType.FULL_PAGE:
- break;
-
- default:
- throw new Error('Unknown dialog type: ' + this.dialogType_);
- }
-
- this.okButton.textContent = okLabel;
this.element_.setAttribute('type', this.dialogType_);
};
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/ui/dialog_footer.js ('k') | ui/file_manager/file_manager/main.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698