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

Side by Side Diff: chrome/browser/resources/file_manager/foreground/js/file_transfer_controller.js

Issue 143653014: Fix dragging onto shortcuts in the volume list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 * Global (placed in the window object) variable name to hold internal 8 * Global (placed in the window object) variable name to hold internal
9 * file dragging information. Needed to show visual feedback while dragging 9 * file dragging information. Needed to show visual feedback while dragging
10 * since DataTransfer object is in protected state. Reachable from other 10 * since DataTransfer object is in protected state. Reachable from other
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 onDragEnterVolumesList_: function(list, event) { 427 onDragEnterVolumesList_: function(list, event) {
428 event.preventDefault(); // Required to prevent the cursor flicker. 428 event.preventDefault(); // Required to prevent the cursor flicker.
429 this.lastEnteredTarget_ = event.target; 429 this.lastEnteredTarget_ = event.target;
430 var item = list.getListItemAncestor(event.target); 430 var item = list.getListItemAncestor(event.target);
431 item = item && list.isItem(item) ? item : null; 431 item = item && list.isItem(item) ? item : null;
432 if (item === this.dropTarget_) 432 if (item === this.dropTarget_)
433 return; 433 return;
434 434
435 var modelItem = item && list.dataModel.item(item.listIndex); 435 var modelItem = item && list.dataModel.item(item.listIndex);
436 if (modelItem.isShortcut) { 436 if (modelItem.isShortcut) {
437 this.setDropTarget_(item, event.dataTransfer, entry); 437 this.setDropTarget_(item, event.dataTransfer, modelItem.entry);
438 } else if (modelItem.isVolume && modelItem.volumeInfo.displayRoot) { 438 } else if (modelItem.isVolume && modelItem.volumeInfo.displayRoot) {
439 this.setDropTarget_( 439 this.setDropTarget_(
440 item, event.dataTransfer, modelItem.volumeInfo.displayRoot); 440 item, event.dataTransfer, modelItem.volumeInfo.displayRoot);
441 } else { 441 } else {
442 this.clearDropTarget_(); 442 this.clearDropTarget_();
443 } 443 }
444 }, 444 },
445 445
446 /** 446 /**
447 * @this {FileTransferController} 447 * @this {FileTransferController}
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 !event.ctrlKey) { 872 !event.ctrlKey) {
873 return 'move'; 873 return 'move';
874 } 874 }
875 if (event.dataTransfer.effectAllowed === 'copyMove' && 875 if (event.dataTransfer.effectAllowed === 'copyMove' &&
876 event.shiftKey) { 876 event.shiftKey) {
877 return 'move'; 877 return 'move';
878 } 878 }
879 return 'copy'; 879 return 'copy';
880 }, 880 },
881 }; 881 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698