mirror of
https://github.com/FoggedLens/iD.git
synced 2026-04-01 09:40:38 +02:00
Flash the disabled message for touch interaction for the save button (re: #7699)
Don't flash undo/redo tooltip text when the map isn't editable
This commit is contained in:
@@ -80,10 +80,32 @@ export function uiToolSave(context) {
|
||||
.keys([key])
|
||||
.scrollContainer(context.container().select('.top-toolbar'));
|
||||
|
||||
var lastPointerUpType;
|
||||
|
||||
button = selection
|
||||
.append('button')
|
||||
.attr('class', 'save disabled bar-button')
|
||||
.on('click', save)
|
||||
.on('pointerup', function() {
|
||||
lastPointerUpType = d3_event.pointerType;
|
||||
})
|
||||
.on('click', function() {
|
||||
d3_event.preventDefault();
|
||||
|
||||
save();
|
||||
|
||||
if (_numChanges === 0 && (
|
||||
lastPointerUpType === 'touch' ||
|
||||
lastPointerUpType === 'pen')
|
||||
) {
|
||||
// there are no tooltips for touch interactions so flash feedback instead
|
||||
context.ui().flash
|
||||
.duration(2000)
|
||||
.iconName('#iD-icon-save')
|
||||
.iconClass('disabled')
|
||||
.text(t('save.no_changes'))();
|
||||
}
|
||||
lastPointerUpType = null;
|
||||
})
|
||||
.call(tooltipBehavior);
|
||||
|
||||
button
|
||||
|
||||
@@ -79,8 +79,10 @@ export function uiToolUndoRedo(context) {
|
||||
d.action();
|
||||
}
|
||||
|
||||
if (lastPointerUpType === 'touch' ||
|
||||
lastPointerUpType === 'pen') {
|
||||
if (editable() && (
|
||||
lastPointerUpType === 'touch' ||
|
||||
lastPointerUpType === 'pen')
|
||||
) {
|
||||
// there are no tooltips for touch interactions so flash feedback instead
|
||||
|
||||
var text = annotation ?
|
||||
|
||||
Reference in New Issue
Block a user