From 146ba3ed8a2e965b9017166add02659997189661 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 25 Jan 2013 16:56:51 -0500 Subject: [PATCH] Cleanup tooltip refreshing --- js/id/id.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/id/id.js b/js/id/id.js index 951603357..314a1d51a 100644 --- a/js/id/id.js +++ b/js/id/id.js @@ -190,7 +190,9 @@ window.iD = function(container) { redo = history.redoAnnotation(); function refreshTooltip(selection) { - if (selection.property('tooltipVisible')) { + if (selection.property('disabled')) { + selection.call(undo_tooltip.hide); + } else if (selection.property('tooltipVisible')) { selection.call(undo_tooltip.show); } } @@ -198,12 +200,12 @@ window.iD = function(container) { limiter.select('#undo') .property('disabled', !undo) .attr('data-original-title', undo) - .call(undo ? refreshTooltip : undo_tooltip.hide); + .call(refreshTooltip); limiter.select('#redo') .property('disabled', !redo) .attr('data-original-title', redo) - .call(redo ? refreshTooltip : undo_tooltip.hide); + .call(refreshTooltip); }); d3.select(window).on('resize.editor', function() {