mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-18 14:45:12 +02:00
Properly update undo/redo button tooltips when undoing/redoing (close #6872)
This commit is contained in:
@@ -97,8 +97,8 @@ export function uiToolUndoRedo(context) {
|
||||
})
|
||||
.each(function() {
|
||||
var selection = d3_select(this);
|
||||
if (selection.property('tooltipVisible')) {
|
||||
selection.call(tooltipBehavior.show);
|
||||
if (!selection.select('.tooltip.in').empty()) {
|
||||
selection.call(tooltipBehavior.updateContent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -81,6 +81,10 @@ export function popover(klass) {
|
||||
_anchorSelection.each(show);
|
||||
};
|
||||
|
||||
popover.updateContent = function() {
|
||||
_anchorSelection.each(updateContent);
|
||||
};
|
||||
|
||||
popover.hide = function() {
|
||||
_anchorSelection.each(hide);
|
||||
};
|
||||
@@ -198,6 +202,13 @@ export function popover(klass) {
|
||||
popoverSelection.node().focus();
|
||||
}
|
||||
|
||||
anchor.each(updateContent);
|
||||
}
|
||||
|
||||
function updateContent() {
|
||||
var anchor = d3_select(this);
|
||||
var popoverSelection = anchor.selectAll('.popover-' + _id);
|
||||
|
||||
if (_content) popoverSelection.selectAll('.popover-inner').call(_content.apply(this, arguments));
|
||||
|
||||
updatePosition.apply(this, arguments);
|
||||
|
||||
Reference in New Issue
Block a user