| Index: ui/file_manager/file_manager/foreground/js/task_controller.js
|
| diff --git a/ui/file_manager/file_manager/foreground/js/task_controller.js b/ui/file_manager/file_manager/foreground/js/task_controller.js
|
| index 8126570201a14582b44a6b63f40207c61487fe51..c7457d171270354a72faff62ed2170f1e8fde74a 100644
|
| --- a/ui/file_manager/file_manager/foreground/js/task_controller.js
|
| +++ b/ui/file_manager/file_manager/foreground/js/task_controller.js
|
| @@ -90,6 +90,11 @@ function TaskController(
|
| */
|
| this.tasks_ = null;
|
|
|
| + /**
|
| + * @private {!Array<!Entry>}
|
| + */
|
| + this.lastSelectedEntries_ = [];
|
| +
|
| ui.taskMenuButton.addEventListener(
|
| 'select', this.onTaskItemClicked_.bind(this));
|
| this.selectionHandler_.addEventListener(
|
| @@ -267,14 +272,18 @@ TaskController.prototype.onSelectionChanged_ = function() {
|
| // FileSelectionHandler.EventType.CHANGE
|
| if (this.dialogType_ === DialogType.FULL_PAGE &&
|
| (selection.directoryCount > 0 || selection.fileCount > 0)) {
|
| - // Show disabled items for position calculation of the menu. They will be
|
| - // overridden in this.updateFileSelectionAsync().
|
| - this.updateContextMenuTaskItems_(
|
| - [TaskController.createTemporaryDisabledTaskItem_()]);
|
| + // Compare entries while ignoring changes inside directories.
|
| + if (!util.isSameEntries(this.lastSelectedEntries_, selection.entries)) {
|
| + // Show disabled items for position calculation of the menu. They will be
|
| + // overridden in this.updateTasks_().
|
| + this.updateContextMenuTaskItems_(
|
| + [TaskController.createTemporaryDisabledTaskItem_()]);
|
| + }
|
| } else {
|
| // Update context menu.
|
| this.updateContextMenuTaskItems_([]);
|
| }
|
| + this.lastSelectedEntries_ = selection.entries;
|
| };
|
|
|
| /**
|
|
|