Skip to content

Commit

Permalink
Allow to select class from item menu
Browse files Browse the repository at this point in the history
  • Loading branch information
frodrigo committed Dec 28, 2023
1 parent bf9cf9d commit 5520fdd
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions web/src/pages/map/items-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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

View workflow job for this annotation

GitHub Actions / lint-web

Replace `·v-if="class_detail_open·==·item.item"·@click="class_detail_open·=·undefined"·class="class_detail">-</span` with `⏎··············v-if="class_detail_open·==·item.item"⏎··············@click="class_detail_open·=·undefined"⏎··············class="class_detail"⏎··············>-</span⏎············`
<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

View workflow job for this annotation

GitHub Actions / lint-web

Replace `·v-else·@click="class_detail_open·=·item.item"·class="class_detail">+</span` with `⏎··············v-else⏎··············@click="class_detail_open·=·item.item"⏎··············class="class_detail"⏎··············>+</span⏎············`
</span>
<div v-if="class_detail_open == item.item">
<ul>
<li v-for="classs in item.class" :key="classs.class">

Check failure on line 70 in web/src/pages/map/items-list.vue

View workflow job for this annotation

GitHub Actions / lint-web

Insert `··`
<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

View workflow job for this annotation

GitHub Actions / lint-web

Replace `<a·href=""·@click.prevent="set_item_class(item.item,·classs.class)">⌖·{{classs.class}}·{{classs.title.auto}}</a` with `··<a⏎··················href=""⏎··················@click.prevent="set_item_class(item.item,·classs.class)"⏎··················>⌖·{{·classs.class·}}·{{·classs.title.auto·}}</a⏎················`
</li>

Check failure on line 72 in web/src/pages/map/items-list.vue

View workflow job for this annotation

GitHub Actions / lint-web

Insert `··`
</ul>
</div>
</li>
</ul>
</div>
Expand Down Expand Up @@ -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

Check failure on line 115 in web/src/pages/map/items-list.vue

View workflow job for this annotation

GitHub Actions / lint-web

Insert `,`
}
},
Expand Down Expand Up @@ -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) =>

Check failure on line 225 in web/src/pages/map/items-list.vue

View workflow job for this annotation

GitHub Actions / lint-web

Replace `⏎········item.item·===·item_id⏎······` with `·item.item·===·item_id`
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'
Expand Down Expand Up @@ -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>

0 comments on commit 5520fdd

Please sign in to comment.