diff options
author | dhg@chromium.org <dhg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-02 16:35:00 +0000 |
---|---|---|
committer | dhg@chromium.org <dhg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-02 16:35:00 +0000 |
commit | 799185ae9f4d034fd11b052cd3ff7ed1e12c10c2 (patch) | |
tree | cc2a5e5a2552562f99f45b2a07a70492fad8abaa /chrome/browser/resources/filebrowse.html | |
parent | 27ebb38a560efa2752019b5b236f4c96cdbd732d (diff) | |
download | chromium_src-799185ae9f4d034fd11b052cd3ff7ed1e12c10c2.zip chromium_src-799185ae9f4d034fd11b052cd3ff7ed1e12c10c2.tar.gz chromium_src-799185ae9f4d034fd11b052cd3ff7ed1e12c10c2.tar.bz2 |
Adding support for selecting a directory.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/660345
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40384 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources/filebrowse.html')
-rw-r--r-- | chrome/browser/resources/filebrowse.html | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/chrome/browser/resources/filebrowse.html b/chrome/browser/resources/filebrowse.html index ce484a8..c00beaf422 100644 --- a/chrome/browser/resources/filebrowse.html +++ b/chrome/browser/resources/filebrowse.html @@ -539,6 +539,7 @@ var rootsDiv = null; var currentlySelectedItems = new Array(); var currentlySelectedPaths = new Array(); var multiSelect = false; +var selectFolder = false; var inSaveMode = false; var currentMenu = null; var mainColumn = null; @@ -975,12 +976,18 @@ function load() { var args = JSON.parse(chrome.dialogArguments); if (args.type == 'open') { multiSelect = false; + selectFolder = false; } else if (args.type == 'save') { inSaveMode = true; + selectFolder = false; } else if (args.type == 'open_multiple') { multiSelect = true; + selectFolder = false; + } else if (args.type == 'folder') { + multiSelect = false; + selectFolder = true; } else { - alert ('got unknown type'); + alert ('got unknown type' + args.type); } inSelectMode = true; if (inSaveMode) { @@ -1094,6 +1101,10 @@ function descend(path, nodeNumber) { } jumpToNode(nodeNumber); currentNode++; + if (selectFolder) { + currentlySelectedPaths = []; + currentlySelectedPaths.push(path); + } pathArray.push(path); getDataForPath(path); }; @@ -1218,6 +1229,8 @@ function selectItem(elementid, path) { for (var x = 0; x < currentlySelectedItems.length; x++) { currentlySelectedItems[x].className = 'filebrowserow'; } + currentlySelectedItems = []; + currentlySelectedPaths = []; } element.className = 'selected filebrowserow'; currentlySelectedItems.push(element); |