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

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

Issue 282303006: Gallery.app: Fix the task list of the separated version of Gallery. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/file_manager/gallery/manifest.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 'use strict'; 5 'use strict';
6 6
7 /** 7 /**
8 * Called from the main frame when unloading. 8 * Called from the main frame when unloading.
9 * @param {boolean=} opt_exiting True if the app is exiting. 9 * @param {boolean=} opt_exiting True if the app is exiting.
10 */ 10 */
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 var createShareMenu = function(tasks) { 813 var createShareMenu = function(tasks) {
814 var wasHidden = this.shareMenu_.hidden; 814 var wasHidden = this.shareMenu_.hidden;
815 this.shareMenu_.hidden = true; 815 this.shareMenu_.hidden = true;
816 var items = this.shareMenu_.querySelectorAll('.item'); 816 var items = this.shareMenu_.querySelectorAll('.item');
817 for (var i = 0; i !== items.length; i++) { 817 for (var i = 0; i !== items.length; i++) {
818 items[i].parentNode.removeChild(items[i]); 818 items[i].parentNode.removeChild(items[i]);
819 } 819 }
820 820
821 for (var t = 0; t !== tasks.length; t++) { 821 for (var t = 0; t !== tasks.length; t++) {
822 var task = tasks[t]; 822 var task = tasks[t];
823 if (!isShareAction(task)) continue; 823 if (!isShareAction(task))
824 continue;
825 // Filter out Files.app tasks.
826 // TODO(hirono): Remove the hack after the files.app's handlers are
827 // removed.
828 if (task.taskId.indexOf('hhaomjibdihmijegdhdafkllkbggdgoj|') === 0)
829 continue;
824 830
825 var item = util.createChild(this.shareMenu_, 'item'); 831 var item = util.createChild(this.shareMenu_, 'item');
826 item.textContent = task.title; 832 item.textContent = task.title;
827 item.style.backgroundImage = 'url(' + task.iconUrl + ')'; 833 item.style.backgroundImage = 'url(' + task.iconUrl + ')';
828 item.addEventListener('click', function(taskId) { 834 item.addEventListener('click', function(taskId) {
829 this.toggleShare_(); // Hide the menu. 835 this.toggleShare_(); // Hide the menu.
830 // TODO(hirono): Use entries instead of URLs. 836 // TODO(hirono): Use entries instead of URLs.
831 this.executeWhenReady( 837 this.executeWhenReady(
832 api.executeTask.bind( 838 api.executeTask.bind(
833 api, 839 api,
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 ]).then(function(args) { 899 ]).then(function(args) {
894 var backgroundComponents = args[0]; 900 var backgroundComponents = args[0];
895 var entries = args[1]; 901 var entries = args[1];
896 window.loadTimeData.data = backgroundComponents.stringData; 902 window.loadTimeData.data = backgroundComponents.stringData;
897 var gallery = new Gallery(backgroundComponents.volumeManager); 903 var gallery = new Gallery(backgroundComponents.volumeManager);
898 gallery.load(entries.allEntries, entries.selectedEntries); 904 gallery.load(entries.allEntries, entries.selectedEntries);
899 }).catch(function(error) { 905 }).catch(function(error) {
900 console.error(error.stack || error); 906 console.error(error.stack || error);
901 }); 907 });
902 }); 908 });
OLDNEW
« no previous file with comments | « no previous file | ui/file_manager/gallery/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698