Option to collapse preset fields section

(closes #2894)
This commit is contained in:
Bryan Housel
2016-01-29 00:40:37 -05:00
parent ecb0db7009
commit 7afa0e4ad2
4 changed files with 19 additions and 16 deletions

View File

@@ -946,6 +946,11 @@ button.save.has-count .count::before {
.inspector-preset {
overflow: hidden;
padding-bottom: 10px;
}
.inspector-preset a.hide-toggle {
margin: 0 20px 10px 20px;
}
.inspector-preset .preset-form {
@@ -954,25 +959,10 @@ button.save.has-count .count::before {
border-radius: 8px;
}
.entity-editor-pane .preset-list-item::after {
content: "";
position: absolute;
height: 0;
width: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
border: solid rgba(0, 0, 0, 0);
border-width: 10px;
border-bottom-color: #ececec;
}
.entity-editor-pane .preset-list-item .preset-list-button-wrap {
margin-bottom: 0;
}
.form-field {
margin-bottom: 10px;
width: 100%;

View File

@@ -235,6 +235,7 @@ en:
no_documentation_key: There is no documentation available for this key
show_more: Show More
view_on_osm: View on openstreetmap.org
all_fields: All fields
all_tags: All tags
all_members: All members
all_relations: All relations

File diff suppressed because one or more lines are too long

View File

@@ -60,6 +60,18 @@ iD.ui.preset = function(context) {
}
function presets(selection) {
selection.call(iD.ui.Disclosure()
.title(t('inspector.all_fields'))
.expanded(context.storage('preset_fields.expanded') !== 'false')
.on('toggled', toggled)
.content(content));
function toggled(expanded) {
context.storage('preset_fields.expanded', expanded);
}
}
function content(selection) {
if (!fields) {
var entity = context.entity(id),
geometry = context.geometry(id);