Don't show save warning in editor tab on options apply

This commit is contained in:
Norbert Renner 2019-11-13 11:11:14 +01:00
parent 4efa6247aa
commit a006d64a6d
2 changed files with 10 additions and 10 deletions

View file

@ -1,5 +1,6 @@
BR.Profile = L.Evented.extend({ BR.Profile = L.Evented.extend({
cache: {}, cache: {},
saveWarningShown: false,
initialize: function() { initialize: function() {
var textArea = L.DomUtil.get('profile_upload'); var textArea = L.DomUtil.get('profile_upload');
@ -80,15 +81,19 @@ BR.Profile = L.Evented.extend({
this.message.hide(); this.message.hide();
evt.preventDefault(); evt.preventDefault();
var that = this;
this.fire('update', { this.fire('update', {
profileText: profile, profileText: profile,
callback: function(err, profileId, profileText) { callback: L.bind(function(err, profileId, profileText) {
$(button).blur(); $(button).blur();
if (!err) { if (!err) {
that.cache[profileId] = profileText; this.cache[profileId] = profileText;
if (!this.saveWarningShown) {
this.message.showWarning(i18next.t('warning.temporary-profile'));
this.saveWarningShown = true;
}
} }
} }, this)
}); });
}, },

View file

@ -33,8 +33,7 @@
drawButton, drawButton,
deleteRouteButton, deleteRouteButton,
pois, pois,
urlHash, urlHash;
saveWarningShown = false;
// By default bootstrap-select use glyphicons // By default bootstrap-select use glyphicons
$('.selectpicker').selectpicker({ $('.selectpicker').selectpicker({
@ -179,10 +178,6 @@
updateRoute({ updateRoute({
options: routingOptions.getOptions() options: routingOptions.getOptions()
}); });
if (!saveWarningShown) {
profile.message.showWarning(i18next.t('warning.temporary-profile'));
saveWarningShown = true;
}
} else { } else {
profile.message.showError(err); profile.message.showError(err);
if (profileId) { if (profileId) {