mirror of
https://github.com/FoggedLens/iD.git
synced 2026-06-05 22:46:38 +02:00
WIP drag note
This commit is contained in:
+2
-2
@@ -16,6 +16,7 @@ import {
|
||||
import { svgIcon } from '../svg';
|
||||
import { tooltip } from '../util/tooltip';
|
||||
import { uiTooltipHtml } from './tooltipHtml';
|
||||
import { services } from '../services/index.js';
|
||||
|
||||
|
||||
export function uiModes(context) {
|
||||
@@ -36,7 +37,7 @@ export function uiModes(context) {
|
||||
function toggleNewNote() {
|
||||
return svgNotes().enabled()
|
||||
&& context.connection().authenticated()
|
||||
&& ~~context.map().zoom() >= 12;
|
||||
&& ~~context.map().zoom() >= 16;
|
||||
}
|
||||
|
||||
|
||||
@@ -97,7 +98,6 @@ export function uiModes(context) {
|
||||
|
||||
modes.forEach(function(mode) {
|
||||
keybinding.on(mode.key, function() {
|
||||
// TODO: allow zooming out beyond minZoom when adding new note. Currently prevented
|
||||
if ((editable() && mode.id !== 'add-note') || (toggleNewNote() && mode.id === 'add-note')) {
|
||||
if (mode.id === context.mode().id) {
|
||||
context.enter(modeBrowse(context));
|
||||
|
||||
@@ -40,7 +40,11 @@ export function uiNoteEditor(context) {
|
||||
headerEnter
|
||||
.append('button')
|
||||
.attr('class', 'fr note-editor-close')
|
||||
.on('click', function() { context.enter(modeBrowse(context)); })
|
||||
.on('click', function() {
|
||||
var osm = services.osm;
|
||||
if (_note.isNew()) { osm.removeNote(_note); } // delete new note
|
||||
context.enter(modeBrowse(context));
|
||||
})
|
||||
.call(svgIcon('#iD-icon-close'));
|
||||
|
||||
headerEnter
|
||||
|
||||
Reference in New Issue
Block a user