Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Called from the main frame when unloading. | 8 * Called from the main frame when unloading. |
| 9 * @return {string?} User-visible message on null if it is OK to close. | 9 * @return {string?} User-visible message on null if it is OK to close. |
| 10 */ | 10 */ |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 630 }; | 630 }; |
| 631 | 631 |
| 632 // Name box and rename support. | 632 // Name box and rename support. |
| 633 | 633 |
| 634 /** | 634 /** |
| 635 * Updates the UI related to the selected item and the persistent state. | 635 * Updates the UI related to the selected item and the persistent state. |
| 636 * | 636 * |
| 637 * @private | 637 * @private |
| 638 */ | 638 */ |
| 639 Gallery.prototype.updateSelectionAndState_ = function() { | 639 Gallery.prototype.updateSelectionAndState_ = function() { |
| 640 var numSelectedItems = this.selectionModel_.length; | 640 var selectedIndex = this.selectionModel_.selectedIndex; |
| 641 var numSelectedItems = selectedIndex.length; | |
|
hirono
2014/02/13 06:42:22
this.selectedIndexes.length?
hirono
2014/02/13 06:43:26
No, this.selectionModel_.selectedIndexes.length?
| |
| 641 var displayName = ''; | 642 var displayName = ''; |
| 642 var selectedEntryURL = null; | 643 var selectedEntryURL = null; |
| 643 | 644 |
| 644 // If it's selecting something, update the variable values. | 645 // If it's selecting something, update the variable values. |
| 645 if (numSelectedItems) { | 646 if (numSelectedItems) { |
| 646 var selectedIndex = this.selectionModel_.selectedIndex; | |
| 647 var selectedItem = | 647 var selectedItem = |
| 648 this.dataModel_.item(this.selectionModel_.selectedIndex); | 648 this.dataModel_.item(this.selectionModel_.selectedIndex); |
| 649 this.selectedEntry_ = selectedItem.getEntry(); | 649 this.selectedEntry_ = selectedItem.getEntry(); |
| 650 selectedEntryURL = this.selectedEntry_.toURL(); | 650 selectedEntryURL = this.selectedEntry_.toURL(); |
| 651 | 651 |
| 652 if (numSelectedItems === 1) { | 652 if (numSelectedItems === 1) { |
| 653 window.top.document.title = this.selectedEntry_.name; | 653 window.top.document.title = this.selectedEntry_.name; |
| 654 displayName = ImageUtil.getDisplayNameFromName(this.selectedEntry_.name); | 654 displayName = ImageUtil.getDisplayNameFromName(this.selectedEntry_.name); |
| 655 } else if (this.context_.curDirEntry) { | 655 } else if (this.context_.curDirEntry) { |
| 656 // If the Gallery was opened on search results the search query will not | 656 // If the Gallery was opened on search results the search query will not |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 865 */ | 865 */ |
| 866 Gallery.prototype.updateButtons_ = function() { | 866 Gallery.prototype.updateButtons_ = function() { |
| 867 if (this.modeButton_) { | 867 if (this.modeButton_) { |
| 868 var oppositeMode = | 868 var oppositeMode = |
| 869 this.currentMode_ === this.slideMode_ ? this.mosaicMode_ : | 869 this.currentMode_ === this.slideMode_ ? this.mosaicMode_ : |
| 870 this.slideMode_; | 870 this.slideMode_; |
| 871 this.modeButton_.title = | 871 this.modeButton_.title = |
| 872 this.displayStringFunction_(oppositeMode.getTitle()); | 872 this.displayStringFunction_(oppositeMode.getTitle()); |
| 873 } | 873 } |
| 874 }; | 874 }; |
| OLD | NEW |