diff --git a/modules/svg/notes.js b/modules/svg/notes.js index 344e75e64..7680dacc8 100644 --- a/modules/svg/notes.js +++ b/modules/svg/notes.js @@ -1,15 +1,13 @@ import _throttle from 'lodash-es/throttle'; + import { select as d3_select } from 'd3-selection'; + import { svgPointTransform } from './index'; import { services } from '../services'; -import { osmNote } from '../osm'; - -import { uiNoteEditor } from '../ui'; export function svgNotes(projection, context, dispatch) { var throttledRedraw = _throttle(function () { dispatch.call('change'); }, 1000); - // var noteEditor = uiNoteEditor(context); var minZoom = 12; var layer = d3_select(null); var _notes; @@ -31,6 +29,7 @@ export function svgNotes(projection, context, dispatch) { layer.style('display', 'none'); } + function getService() { if (services.osm && !_notes) { _notes = services.osm; @@ -42,6 +41,7 @@ export function svgNotes(projection, context, dispatch) { return _notes; } + function showLayer() { editOn(); @@ -53,6 +53,7 @@ export function svgNotes(projection, context, dispatch) { .on('end', function () { dispatch.call('change'); }); } + function hideLayer() { throttledRedraw.cancel(); @@ -70,6 +71,7 @@ export function svgNotes(projection, context, dispatch) { } } + function update() { var service = getService(); var selectedID = context.selectedNoteID(); diff --git a/modules/ui/note_editor.js b/modules/ui/note_editor.js index 4a2cbb80a..cb117e769 100644 --- a/modules/ui/note_editor.js +++ b/modules/ui/note_editor.js @@ -10,12 +10,10 @@ import { t } from '../util/locale'; import { svgIcon } from '../svg'; import { services } from '../services'; import { - utilGetSetValue, utilNoAuto, utilRebind } from '../util'; -import { uiField } from './field'; import { utilDetect } from '../util/detect'; var _newComment; @@ -23,9 +21,7 @@ var _newComment; export function uiNoteEditor(context) { var dispatch = d3_dispatch('change', 'cancel', 'save', 'changeInput'); - var formFields = uiFormFields(context); var commentLimit = 600; // add a "more" link to comments longer than this length - var _fieldsArr; var _modified = false; var _note; @@ -337,7 +333,6 @@ export function uiNoteEditor(context) { noteEditor.note = function(_) { if (!arguments.length) return _note; _note = _; - _fieldsArr = null; return noteEditor; };