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

Side by Side Diff: ui/file_manager/gallery/js/gallery.js

Issue 1255143003: Gallery.app: make edit button toggleable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix failed test cases. Created 5 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * Overrided metadata worker's path. 6 * Overrided metadata worker's path.
7 * @type {string} 7 * @type {string}
8 */ 8 */
9 ContentMetadataProvider.WORKER_SCRIPT = '/js/metadata_worker.js'; 9 ContentMetadataProvider.WORKER_SCRIPT = '/js/metadata_worker.js';
10 10
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 this.filenameEdit_.addEventListener('keydown', 95 this.filenameEdit_.addEventListener('keydown',
96 this.onFilenameEditKeydown_.bind(this)); 96 this.onFilenameEditKeydown_.bind(this));
97 97
98 var buttonSpacer = queryRequiredElement(this.topToolbar_, '.button-spacer'); 98 var buttonSpacer = queryRequiredElement(this.topToolbar_, '.button-spacer');
99 99
100 this.prompt_ = new ImageEditor.Prompt(this.container_, strf); 100 this.prompt_ = new ImageEditor.Prompt(this.container_, strf);
101 101
102 this.errorBanner_ = new ErrorBanner(this.container_); 102 this.errorBanner_ = new ErrorBanner(this.container_);
103 103
104 var slideModeButton = queryRequiredElement( 104 var slideModeButton = queryRequiredElement(
105 this.topToolbar_, '.button.slide-mode'); 105 this.topToolbar_, 'paper-button.slide-mode');
106 slideModeButton.addEventListener( 106 slideModeButton.addEventListener(
107 'click', this.onSlideModeButtonClicked_.bind(this)); 107 'click', this.onSlideModeButtonClicked_.bind(this));
108 108
109 var thumbnailModeButton = queryRequiredElement( 109 var thumbnailModeButton = queryRequiredElement(
110 this.topToolbar_, '.button.thumbnail-mode'); 110 this.topToolbar_, 'paper-button.thumbnail-mode');
111 thumbnailModeButton.addEventListener( 111 thumbnailModeButton.addEventListener(
112 'click', this.onThumbnailModeButtonClicked_.bind(this)); 112 'click', this.onThumbnailModeButtonClicked_.bind(this));
113 113
114 this.thumbnailMode_ = new ThumbnailMode( 114 this.thumbnailMode_ = new ThumbnailMode(
115 assertInstanceof(document.querySelector('.thumbnail-view'), HTMLElement), 115 assertInstanceof(document.querySelector('.thumbnail-view'), HTMLElement),
116 this.dataModel_, 116 this.dataModel_,
117 this.selectionModel_, 117 this.selectionModel_,
118 this.changeCurrentMode_.bind(this, this.slideMode_)); 118 this.changeCurrentMode_.bind(this, this.slideMode_));
119 this.thumbnailMode_.hide(); 119 this.thumbnailMode_.hide();
120 120
121 this.slideMode_ = new SlideMode(this.container_, 121 this.slideMode_ = new SlideMode(this.container_,
122 content, 122 content,
123 this.topToolbar_, 123 this.topToolbar_,
124 this.bottomToolbar_, 124 this.bottomToolbar_,
125 this.prompt_, 125 this.prompt_,
126 this.errorBanner_, 126 this.errorBanner_,
127 this.dataModel_, 127 this.dataModel_,
128 this.selectionModel_, 128 this.selectionModel_,
129 this.metadataModel_, 129 this.metadataModel_,
130 this.thumbnailModel_, 130 this.thumbnailModel_,
131 this.context_, 131 this.context_,
132 this.volumeManager_, 132 this.volumeManager_,
133 this.toggleMode_.bind(this), 133 this.toggleMode_.bind(this),
134 str); 134 str);
135 135
136 this.slideMode_.addEventListener('image-displayed', function() { 136 this.slideMode_.addEventListener('image-displayed', function() {
137 cr.dispatchSimpleEvent(this, 'image-displayed'); 137 cr.dispatchSimpleEvent(this, 'image-displayed');
138 }.bind(this)); 138 }.bind(this));
139 139
140 this.deleteButton_ = queryRequiredElement(this.topToolbar_, '.button.delete'); 140 this.deleteButton_ = queryRequiredElement(
141 this.topToolbar_, 'paper-button.delete');
141 this.deleteButton_.addEventListener('click', this.delete_.bind(this)); 142 this.deleteButton_.addEventListener('click', this.delete_.bind(this));
142 143
143 this.shareButton_ = queryRequiredElement(this.topToolbar_, '.button.share'); 144 this.shareButton_ = queryRequiredElement(
145 this.topToolbar_, 'paper-button.share');
144 this.shareButton_.addEventListener( 146 this.shareButton_.addEventListener(
145 'click', this.onShareButtonClick_.bind(this)); 147 'click', this.onShareButtonClick_.bind(this));
146 148
147 this.dataModel_.addEventListener('splice', this.onSplice_.bind(this)); 149 this.dataModel_.addEventListener('splice', this.onSplice_.bind(this));
148 this.dataModel_.addEventListener('content', this.onContentChange_.bind(this)); 150 this.dataModel_.addEventListener('content', this.onContentChange_.bind(this));
149 151
150 this.selectionModel_.addEventListener('change', this.onSelection_.bind(this)); 152 this.selectionModel_.addEventListener('change', this.onSelection_.bind(this));
151 this.slideMode_.addEventListener('useraction', this.onUserAction_.bind(this)); 153 this.slideMode_.addEventListener('useraction', this.onUserAction_.bind(this));
152 154
153 this.shareDialog_ = new ShareDialog(this.container_); 155 this.shareDialog_ = new ShareDialog(this.container_);
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 */ 888 */
887 var initializePromise = 889 var initializePromise =
888 Promise.all([loadTimeDataPromise, volumeManagerPromise]). 890 Promise.all([loadTimeDataPromise, volumeManagerPromise]).
889 then(function(args) { 891 then(function(args) {
890 var volumeManager = args[1]; 892 var volumeManager = args[1];
891 gallery = new Gallery(volumeManager); 893 gallery = new Gallery(volumeManager);
892 }); 894 });
893 895
894 // Loads entries. 896 // Loads entries.
895 initializePromise.then(reload); 897 initializePromise.then(reload);
OLDNEW
« no previous file with comments | « ui/file_manager/gallery/js/compiled_resources.gyp ('k') | ui/file_manager/gallery/js/slide_mode.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698