diff --git a/js/id/ui/save.js b/js/id/ui/save.js index 601e3a67d..7fb733d06 100644 --- a/js/id/ui/save.js +++ b/js/id/ui/save.js @@ -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); diff --git a/locale/en.js b/locale/en.js index 55ef464ad..48f5b736b 100644 --- a/locale/en.js +++ b/locale/en.js @@ -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"