mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-12 12:41:58 +02:00
Better save blocking in intro (closes #1795)
Previous code blocked the button click handler only, not the ⌘S keybinding
This commit is contained in:
+3
-7
@@ -17,6 +17,9 @@ iD.ui.intro = function(context) {
|
||||
baseEntities = context.history().graph().base().entities,
|
||||
introGraph;
|
||||
|
||||
// Block saving
|
||||
context.inIntro(true);
|
||||
|
||||
// Load semi-real data used in intro
|
||||
context.connection().toggle(false).flush();
|
||||
context.history().reset();
|
||||
@@ -28,12 +31,6 @@ iD.ui.intro = function(context) {
|
||||
context.history().merge(d3.values(iD.Graph().load(introGraph).entities));
|
||||
context.background().bing();
|
||||
|
||||
// Block saving
|
||||
var savebutton = d3.select('#bar button.save'),
|
||||
save = savebutton.on('click');
|
||||
savebutton.on('click', null);
|
||||
context.inIntro(true);
|
||||
|
||||
d3.select('.background-layer').style('opacity', 1);
|
||||
|
||||
var curtain = d3.curtain();
|
||||
@@ -67,7 +64,6 @@ iD.ui.intro = function(context) {
|
||||
context.map().centerZoom(center, zoom);
|
||||
window.location.replace(hash);
|
||||
context.inIntro(false);
|
||||
d3.select('#bar button.save').on('click', save);
|
||||
});
|
||||
|
||||
var navwrap = selection.append('div').attr('class', 'intro-nav-wrap fillD');
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ iD.ui.Save = function(context) {
|
||||
|
||||
function save() {
|
||||
d3.event.preventDefault();
|
||||
if (!saving() && history.hasChanges()) {
|
||||
if (!context.inIntro() && !saving() && history.hasChanges()) {
|
||||
context.enter(iD.modes.Save(context));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user