mirror of
https://github.com/FoggedLens/iD.git
synced 2026-06-01 12:41:36 +02:00
Make the mode buttons dynamic
- show/hide the note button when the notes layer is enabled/disabled - enable/disable the note button based on notesEditable
This commit is contained in:
@@ -212,7 +212,7 @@ export function rendererMap(context) {
|
||||
.call(context.background());
|
||||
|
||||
context.on('enter.map', function() {
|
||||
if ((map.editable() && !_transformed) || map.noteEditable()) {
|
||||
if (map.editable() && !_transformed) {
|
||||
// redraw immediately any objects affected by a change in selectedIDs.
|
||||
var graph = context.graph();
|
||||
var selectedAndParents = {};
|
||||
@@ -240,7 +240,6 @@ export function rendererMap(context) {
|
||||
|
||||
dispatch.call('drawn', this, { full: false });
|
||||
|
||||
|
||||
// redraw everything else later
|
||||
scheduleRedraw();
|
||||
}
|
||||
@@ -481,7 +480,8 @@ export function rendererMap(context) {
|
||||
.call(drawLayers);
|
||||
|
||||
// OSM
|
||||
if (map.editable() || map.noteEditable()) { // NOTE: when `map.noteEditable()` is removed, `redraw()` keep being called on timer
|
||||
// NOTE: when `map.notesEditable()` is removed, `redraw()` keep being called on timer
|
||||
if (map.editable() || map.notesEditable()) {
|
||||
context.loadTiles(projection);
|
||||
drawVector(difference, extent);
|
||||
}
|
||||
@@ -849,7 +849,7 @@ export function rendererMap(context) {
|
||||
};
|
||||
|
||||
|
||||
map.noteEditable = function() {
|
||||
map.notesEditable = function() {
|
||||
var noteLayer = surface.selectAll('.data-layer-notes');
|
||||
if (!noteLayer.empty() && noteLayer.classed('disabled')) return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user