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

Unified Diff: ui/file_manager/file_manager/common/js/util.js

Issue 884183006: Files.app: Add UI to toggle and clear item selection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments. Created 5 years, 10 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/common/js/util.js
diff --git a/ui/file_manager/file_manager/common/js/util.js b/ui/file_manager/file_manager/common/js/util.js
index 08487e4c9528045c66f30760a86d4bc4d3484eb6..4993ae16fec7cf404016738d51b2323dcfcf46cc 100644
--- a/ui/file_manager/file_manager/common/js/util.js
+++ b/ui/file_manager/file_manager/common/js/util.js
@@ -1029,3 +1029,24 @@ util.addEventListenerToBackgroundComponent = function(target, type, handler) {
target.removeEventListener(type, handler);
});
};
+
+/**
+ * Repeats a given event to a given target with event.ctrlKey set true.
+ * @param {!EventTarget} target Event target which receives the repeated event.
+ * @param {!Event} event Original mouse event.
+ */
+util.repeatMouseEventWithCtrlKey = function(target, event) {
+ event.stopPropagation();
+ event.preventDefault();
+ event = assertInstanceof(event, MouseEvent);
+ var eventWithCtrl = new MouseEvent(event.type, {
+ bubbles: event.bubbles,
+ button: event.button,
+ clientX: event.clientX,
+ clientY: event.clientY,
+ ctrlKey: true,
+ shiftKey: event.shiftKey,
+ target: event.target
+ });
+ target.dispatchEvent(eventWithCtrl);
+};

Powered by Google App Engine
This is Rietveld 408576698