Skip to content

Commit

Permalink
Fix issue where map cursors could be incorrect (close #6450, close #6452
Browse files Browse the repository at this point in the history
)
  • Loading branch information
quincylvania committed May 29, 2019
1 parent 9eee5e9 commit da81fb3
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 24 deletions.
2 changes: 2 additions & 0 deletions modules/core/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,13 @@ export function coreContext() {
context.enter = function(newMode) {
if (mode) {
mode.exit();
container.classed('mode-' + mode.id, false);
dispatch.call('exit', this, mode);
}

mode = newMode;
mode.enter();
container.classed('mode-' + newMode.id, true);
dispatch.call('enter', this, mode);
};

Expand Down
8 changes: 0 additions & 8 deletions modules/ui/tools/add_favorite.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,6 @@ export function uiToolAddFavorite(context) {
.on('enter.editor.favorite', function(entered) {
selection.selectAll('button.add-button')
.classed('active', function(mode) { return entered.button === mode.button; });
context.container()
.classed('mode-' + entered.id, true);
});

context
.on('exit.editor.favorite', function(exited) {
context.container()
.classed('mode-' + exited.id, false);
});

var debouncedUpdate = _debounce(update, 500, { leading: true, trailing: true });
Expand Down
8 changes: 0 additions & 8 deletions modules/ui/tools/add_recent.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,6 @@ export function uiToolAddRecent(context) {
.on('enter.editor.recent', function(entered) {
selection.selectAll('button.add-button')
.classed('active', function(mode) { return entered.button === mode.button; });
context.container()
.classed('mode-' + entered.id, true);
});

context
.on('exit.editor.recent', function(exited) {
context.container()
.classed('mode-' + exited.id, false);
});

var debouncedUpdate = _debounce(update, 500, { leading: true, trailing: true });
Expand Down
8 changes: 0 additions & 8 deletions modules/ui/tools/notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,6 @@ export function uiToolNotes(context) {
.on('enter.editor.notes', function(entered) {
selection.selectAll('button.add-button')
.classed('active', function(mode) { return entered.button === mode.button; });
context.container()
.classed('mode-' + entered.id, true);
});

context
.on('exit.editor.notes', function(exited) {
context.container()
.classed('mode-' + exited.id, false);
});


Expand Down

0 comments on commit da81fb3

Please sign in to comment.