mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-17 22:24:49 +02:00
Only delete saved on hitting reset, fixes #744
This commit is contained in:
@@ -175,12 +175,7 @@ iD.History = function(context) {
|
||||
if (!lock) return;
|
||||
context.storage(getKey('lock'), null);
|
||||
|
||||
if (stack.length <= 1) {
|
||||
context.storage(getKey('history'), null);
|
||||
context.storage(getKey('nextIDs'), null);
|
||||
context.storage(getKey('index'), null);
|
||||
return;
|
||||
}
|
||||
if (stack.length <= 1) return;
|
||||
|
||||
var json = JSON.stringify(stack.map(function(i) {
|
||||
return {
|
||||
@@ -198,6 +193,13 @@ iD.History = function(context) {
|
||||
context.storage(getKey('index'), index);
|
||||
},
|
||||
|
||||
clearSaved: function() {
|
||||
if (!lock) return;
|
||||
context.storage(getKey('history'), null);
|
||||
context.storage(getKey('nextIDs'), null);
|
||||
context.storage(getKey('index'), null);
|
||||
},
|
||||
|
||||
lock: function() {
|
||||
if (context.storage(getKey('lock'))) return false;
|
||||
context.storage(getKey('lock'), true);
|
||||
|
||||
+2
-1
@@ -34,7 +34,8 @@ iD.ui.Restore = function(context) {
|
||||
.attr('class', 'cancel button col6')
|
||||
.text(t('restore.reset'))
|
||||
.on('click', function() {
|
||||
context.history().clearSaved();
|
||||
modal.remove();
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user