mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-15 02:02:56 +00:00
Make use of message area
This commit is contained in:
@@ -30,7 +30,8 @@ iD.ui.Inspector = function() {
|
||||
presetGrid = iD.ui.PresetGrid()
|
||||
.presetData(presetData)
|
||||
.entity(entity)
|
||||
.on('message', message.text)
|
||||
.context(context)
|
||||
.on('message', changeMessage)
|
||||
.on('choose', function(preset) {
|
||||
inspectorbody.call(tagEditor, expert, preset);
|
||||
});
|
||||
@@ -38,11 +39,13 @@ iD.ui.Inspector = function() {
|
||||
tagEditor = iD.ui.TagEditor()
|
||||
.presetData(presetData)
|
||||
.context(context)
|
||||
.on('message', message.text)
|
||||
.on('message', changeMessage)
|
||||
.on('choose', function() {
|
||||
inspectorbody.call(presetGrid);
|
||||
});
|
||||
|
||||
function changeMessage(msg) { message.text(msg);}
|
||||
|
||||
|
||||
if (initial) {
|
||||
inspectorbody.call(presetGrid);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
iD.ui.PresetGrid = function() {
|
||||
var event = d3.dispatch('choose', 'message'),
|
||||
entity,
|
||||
context,
|
||||
presetData;
|
||||
|
||||
function presetgrid(selection) {
|
||||
@@ -10,6 +11,7 @@ iD.ui.PresetGrid = function() {
|
||||
.attr('class', 'fillL');
|
||||
|
||||
var viable = presetData.match(entity);
|
||||
event.message('What kind of ' + entity.geometry(context.graph()) + ' are you adding?');
|
||||
|
||||
var grid = wrap.append('div')
|
||||
.attr('class', 'preset-grid')
|
||||
@@ -21,7 +23,10 @@ iD.ui.PresetGrid = function() {
|
||||
var search = searchwrap.append('input')
|
||||
.attr('class', 'preset-grid-search')
|
||||
.on('keyup', function() {
|
||||
grid.call(drawGrid, filter(search.property('value')));
|
||||
var value = search.property('value'),
|
||||
presets = filter(value);
|
||||
event.message('' + presets.length + ' results for ' + value);
|
||||
grid.call(drawGrid, presets);
|
||||
});
|
||||
|
||||
|
||||
@@ -59,6 +64,12 @@ iD.ui.PresetGrid = function() {
|
||||
return presetgrid;
|
||||
};
|
||||
|
||||
presetgrid.context = function(_) {
|
||||
if (!arguments.length) return context;
|
||||
context = _;
|
||||
return presetgrid;
|
||||
};
|
||||
|
||||
presetgrid.entity = function(_) {
|
||||
if (!arguments.length) return entity;
|
||||
entity = _;
|
||||
|
||||
@@ -2,7 +2,6 @@ iD.ui.TagEditor = function() {
|
||||
var event = d3.dispatch('changeTags', 'choose', 'close', 'change', 'message'),
|
||||
taginfo = iD.taginfo(),
|
||||
presetData = iD.presetData(),
|
||||
expert = false,
|
||||
inspectorbody,
|
||||
entity,
|
||||
presetMatch,
|
||||
@@ -22,7 +21,10 @@ iD.ui.TagEditor = function() {
|
||||
.attr('class', 'inspector-inner tag-wrap fillL2');
|
||||
|
||||
var typewrap = editorwrap.append('div')
|
||||
.attr('class', 'type inspector-inner fillL');
|
||||
.attr('class', 'type inspector-inner fillL')
|
||||
.on('click', function() {
|
||||
event.choose();
|
||||
});
|
||||
|
||||
typewrap.append('h4')
|
||||
.text('Type');
|
||||
@@ -79,6 +81,8 @@ iD.ui.TagEditor = function() {
|
||||
.preset(presetMatch));
|
||||
}
|
||||
|
||||
event.message('Edit ' + (presetMatch && presetMatch.name || ''));
|
||||
|
||||
var taglistwrap = editorwrap.append('div').call(tagList);
|
||||
|
||||
tageditor.tags(entity.tags);
|
||||
|
||||
Reference in New Issue
Block a user