Commit 4204077d authored by yoshiki@chromium.org's avatar yoshiki@chromium.org

[Galley] Fix an exception in clicking a thumbnail

This patch fixes the exception in clicking a thumbnail. It is a regression caused by r249027 and a possible cause of crbug.com/340624.

The 'length' property of the selection model is NOT the number of the selected item. To get it, we need to get the length of 'selectedIndex' property.

BUG=340624
TEST=manually

Review URL: https://codereview.chromium.org/135973012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251290 0039d316-1c4b-4281-b951-d872f2087c98
parent e4f41f51
......@@ -637,13 +637,12 @@ Gallery.prototype.onKeyDown_ = function(event) {
* @private
*/
Gallery.prototype.updateSelectionAndState_ = function() {
var numSelectedItems = this.selectionModel_.length;
var numSelectedItems = this.selectionModel_.selectedIndexes.length;
var displayName = '';
var selectedEntryURL = null;
// If it's selecting something, update the variable values.
if (numSelectedItems) {
var selectedIndex = this.selectionModel_.selectedIndex;
var selectedItem =
this.dataModel_.item(this.selectionModel_.selectedIndex);
this.selectedEntry_ = selectedItem.getEntry();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment