mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 05:30:35 +02:00
WIP: refactor uiCommit into sections, introduce uiChangesetEditor
uiCommit is getting kind of big as we add more to the commit pane. I'm going to split it up and put the field rendering code into a separate module, similar to how uiEntityEditor embeds uiPresetEditor for the fields. This allows us to add a few more fields that users can set on their changesets (like hashtags, source), and even hide them under a "Add field" dropdown.
This commit is contained in:
+13
-1
@@ -6,6 +6,7 @@ import { osmChangeset } from '../osm';
|
||||
import { modeSelect } from '../modes';
|
||||
import { svgIcon } from '../svg';
|
||||
import { tooltip } from '../util/tooltip';
|
||||
import { uiChangesetEditor } from './changeset_editor';
|
||||
import { uiRawTagEditor } from './raw_tag_editor';
|
||||
import { utilDetect } from '../util/detect';
|
||||
import {
|
||||
@@ -41,10 +42,13 @@ export function uiCommit(context) {
|
||||
changeset = new osmChangeset({ tags: tags });
|
||||
}
|
||||
|
||||
var changesetEditor = uiChangesetEditor(context)
|
||||
.on('change', changeTags);
|
||||
var rawTagEditor = uiRawTagEditor(context)
|
||||
.on('change', changeTags);
|
||||
|
||||
var changes = context.history().changes(),
|
||||
summary = context.history().difference().summary(),
|
||||
rawTagEditor = uiRawTagEditor(context).on('change', changeTags),
|
||||
comment = context.storage('comment') || '',
|
||||
commentDate = +context.storage('commentDate') || 0,
|
||||
currDate = Date.now(),
|
||||
@@ -65,6 +69,14 @@ export function uiCommit(context) {
|
||||
.append('div')
|
||||
.attr('class', 'body');
|
||||
|
||||
body
|
||||
.append('div')
|
||||
.attr('class', 'modal-section changeset-editor')
|
||||
.call(changesetEditor
|
||||
.changeset(changeset)
|
||||
.tags(tags)
|
||||
);
|
||||
|
||||
|
||||
// Fields
|
||||
var fieldSection = body
|
||||
|
||||
Reference in New Issue
Block a user