-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to select class from item menu
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,6 +61,17 @@ | |
<router-link target="_blank" :to="`../issues/open?item=${item.item}`"> | ||
{{ item.title.auto }} | ||
</router-link> | ||
<span v-if="item.class.length > 1"> | ||
<span v-if="class_detail_open == item.item" @click="class_detail_open = undefined" class="class_detail">-</span> | ||
Check failure on line 65 in web/src/pages/map/items-list.vue GitHub Actions / lint-web
|
||
<span v-else @click="class_detail_open = item.item" class="class_detail">+</span> | ||
Check failure on line 66 in web/src/pages/map/items-list.vue GitHub Actions / lint-web
|
||
</span> | ||
<div v-if="class_detail_open == item.item"> | ||
<ul> | ||
<li v-for="classs in item.class" :key="classs.class"> | ||
<a href="" @click.prevent="set_item_class(item.item, classs.class)">⌖ {{classs.class}} {{classs.title.auto}}</a> | ||
Check failure on line 71 in web/src/pages/map/items-list.vue GitHub Actions / lint-web
|
||
</li> | ||
</ul> | ||
</div> | ||
</li> | ||
</ul> | ||
</div> | ||
|
@@ -94,12 +105,14 @@ export default Vue.extend({ | |
total_items: { [category: number]: number } | ||
count_items: { [category: number]: number } | ||
state: ItemState | ||
class_detail_open: number | undefined | ||
} { | ||
return { | ||
active_levels: ['1', '2', '3'], | ||
total_items: {}, | ||
count_items: {}, | ||
state: Object.assign({}, this.itemState), | ||
class_detail_open: undefined | ||
} | ||
}, | ||
|
@@ -208,6 +221,15 @@ export default Vue.extend({ | |
this.itemsChanged() | ||
}, | ||
set_item_class(item_id: number, class_id: number): void { | ||
this._select_items_loop((item: Item) => | ||
item.item === item_id | ||
) | ||
this.state.class = class_id | ||
this.$forceUpdate() | ||
this.itemsChanged() | ||
}, | ||
toggle_categorie_block(categ_id: number): void { | ||
const block = document.getElementById(`categorie_block_${categ_id}`) | ||
block.style.height = block.style.height == '0px' ? '' : '0px' | ||
|
@@ -362,4 +384,8 @@ div.level-3.disabled { | |
background: url('~../../../static/images/levels.png') no-repeat; | ||
background-position: -32px -16px; | ||
} | ||
.class_detail { | ||
cursor: pointer; | ||
} | ||
</style> |