diff options
author | dhg@chromium.org <dhg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-18 23:10:23 +0000 |
---|---|---|
committer | dhg@chromium.org <dhg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-18 23:10:23 +0000 |
commit | 24dd80bde5e446e248007e4d1127594c48f1ecf3 (patch) | |
tree | 1da2f84151a96f514fda552228356598699c5af3 /chrome/browser/resources | |
parent | a7fedd46c5167b048b6fa61e95969ca475e06904 (diff) | |
download | chromium_src-24dd80bde5e446e248007e4d1127594c48f1ecf3.zip chromium_src-24dd80bde5e446e248007e4d1127594c48f1ecf3.tar.gz chromium_src-24dd80bde5e446e248007e4d1127594c48f1ecf3.tar.bz2 |
Adding double click to select mode in the filebrowser.
BUG=chromium-os:3357
TEST=none
Review URL: http://codereview.chromium.org/2129012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47587 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources')
-rw-r--r-- | chrome/browser/resources/filebrowse.html | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/chrome/browser/resources/filebrowse.html b/chrome/browser/resources/filebrowse.html index 44274dd..61689bc 100644 --- a/chrome/browser/resources/filebrowse.html +++ b/chrome/browser/resources/filebrowse.html @@ -1423,6 +1423,27 @@ function getFunctionForItem(path, id, isDirectory) { return function() {}; } +/** + * Double click handler for items. + * + * @param {string} path The file path of the item. + * @param {string} id The id for this item. + * @param {boolean} isDirectory Whether this item is a directory. + * @return {Function} The function to handle the double click. + */ +function getDoubleClickForItem(path, id, isDirectory) { + if (isDirectory) { + return function() {}; + } + if (inSelectMode) { + return function() { + selectItem(id, path); + dialogOkClick(); + }; + } + return function() {}; +} + var elementIdCounter = 0; function createNewItem(title, path, isDirectory) { @@ -1434,6 +1455,7 @@ function createNewItem(title, path, isDirectory) { var link; link = document.createElement('div'); link.onclick = getFunctionForItem(path, element.id, isDirectory); + link.ondblclick = getDoubleClickForItem(path, element.id, isDirectory); link.className = 'rowlink'; var icon = document.createElement('div'); |