Fix issue with changing the tag right after selecting the tag's image
This commit is contained in:
parent
58aaf41430
commit
898210065e
1 changed files with 13 additions and 4 deletions
|
@ -367,14 +367,23 @@ ImageHistoryTree.prototype.markPath_ = function(startingNode, isHighlighted) {
|
|||
* Sets the current tag displayed in the tree.
|
||||
*/
|
||||
ImageHistoryTree.prototype.setTag_ = function(tagName) {
|
||||
if (tagName == this.currentTag_) {
|
||||
return;
|
||||
}
|
||||
|
||||
var imageByDBID = this.imageByDBID_;
|
||||
|
||||
// Save the current tag.
|
||||
var previousTagName = this.currentTag_;
|
||||
this.currentTag_ = tagName;
|
||||
|
||||
var imageByDBID = this.imageByDBID_;
|
||||
|
||||
// Update the state of each existing node to no longer be highlighted.
|
||||
if (this.currentImage_) {
|
||||
var currentNode = imageByDBID[this.currentImage_.dbid];
|
||||
var previousImage = this.findImage_(function(image) {
|
||||
return image.tags.indexOf(previousTagName || '(no tag specified)') >= 0;
|
||||
});
|
||||
|
||||
if (previousImage) {
|
||||
var currentNode = imageByDBID[previousImage.dbid];
|
||||
this.markPath_(currentNode, false);
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue