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.
|
* Sets the current tag displayed in the tree.
|
||||||
*/
|
*/
|
||||||
ImageHistoryTree.prototype.setTag_ = function(tagName) {
|
ImageHistoryTree.prototype.setTag_ = function(tagName) {
|
||||||
|
if (tagName == this.currentTag_) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var imageByDBID = this.imageByDBID_;
|
||||||
|
|
||||||
// Save the current tag.
|
// Save the current tag.
|
||||||
|
var previousTagName = this.currentTag_;
|
||||||
this.currentTag_ = tagName;
|
this.currentTag_ = tagName;
|
||||||
|
|
||||||
var imageByDBID = this.imageByDBID_;
|
|
||||||
|
|
||||||
// Update the state of each existing node to no longer be highlighted.
|
// Update the state of each existing node to no longer be highlighted.
|
||||||
if (this.currentImage_) {
|
var previousImage = this.findImage_(function(image) {
|
||||||
var currentNode = imageByDBID[this.currentImage_.dbid];
|
return image.tags.indexOf(previousTagName || '(no tag specified)') >= 0;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (previousImage) {
|
||||||
|
var currentNode = imageByDBID[previousImage.dbid];
|
||||||
this.markPath_(currentNode, false);
|
this.markPath_(currentNode, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue