mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-16 02:32:53 +00:00
Change tooltip for save button depending on disabled state. Fixes #573
This commit is contained in:
@@ -78,10 +78,11 @@ iD.ui.Save = function(context) {
|
||||
.attr('class', 'save col12 disabled')
|
||||
.attr('tabindex', -1)
|
||||
.on('click', save)
|
||||
.attr('data-original-title',
|
||||
iD.ui.tooltipHtml(t('save.no_changes'), key))
|
||||
.call(bootstrap.tooltip()
|
||||
.placement('bottom')
|
||||
.html(true)
|
||||
.title(iD.ui.tooltipHtml(t('save.help'), key)));
|
||||
.html(true));
|
||||
|
||||
button.append('span')
|
||||
.attr('class', 'label')
|
||||
@@ -99,6 +100,11 @@ iD.ui.Save = function(context) {
|
||||
context.history().on('change.save', function() {
|
||||
var hasChanges = history.hasChanges();
|
||||
|
||||
button
|
||||
.attr('data-original-title',
|
||||
iD.ui.tooltipHtml(t(hasChanges ?
|
||||
'save.help' : 'save.no_changes'), key));
|
||||
|
||||
button
|
||||
.classed('disabled', !hasChanges)
|
||||
.classed('has-count', hasChanges);
|
||||
|
||||
@@ -205,6 +205,7 @@ locale.en = {
|
||||
save: {
|
||||
title: "Save",
|
||||
help: "Save changes to OpenStreetMap, making them visible to other users.",
|
||||
no_changes: "No changes to save.",
|
||||
error: "An error occurred while trying to save",
|
||||
uploading: "Uploading changes to OpenStreetMap.",
|
||||
unsaved_changes: "You have unsaved changes"
|
||||
|
||||
Reference in New Issue
Block a user