Commit ff3bc821 authored by matthias.lang's avatar matthias.lang
Browse files

web: minor UI improvements

- use double click to enable single filter of group (resolves #23)
- disable filter icon hover (resolves #15)
- improve group label (resolves #2)
parent dd4a644f
...@@ -74,11 +74,6 @@ ...@@ -74,11 +74,6 @@
color: #FFF; color: #FFF;
} }
.icon:hover {
background-color: #bbb;
border-color: #bbb;
}
/* TODO: asd*/ /* TODO: asd*/
.fa { .fa {
font-size: 1.33333333em; font-size: 1.33333333em;
...@@ -138,10 +133,12 @@ ...@@ -138,10 +133,12 @@
<span v-for="category in filterShow" class="one-third column" v-if="!category.hideInPublicSearch || visitorLoggedIn"> <span v-for="category in filterShow" class="one-third column" v-if="!category.hideInPublicSearch || visitorLoggedIn">
<strong>{{ category.name }}:</strong><br/> <strong>{{ category.name }}:</strong><br/>
<span v-for="filter in category.filters" v-if="!filter.hideInPublicSearch || visitorLoggedIn"> <span v-for="filter in category.filters" v-if="!filter.hideInPublicSearch || visitorLoggedIn">
<span @click="filter.buttonState = !filter.buttonState" <span
class="icon fa" class="icon fa"
:title="filter.displayName" :title="filter.displayName"
v-bind:class="[filter.displayIcon, { 'icon-active': filter.buttonState }]" v-bind:class="[filter.displayIcon, { 'icon-active': filter.buttonState }]"
v-on:click="enableFilter(filter)"
v-on:dblclick="enableOnlyFilter(filter, category.filters)"
style="margin: 5px" style="margin: 5px"
> >
<!-- <small>{{ filter.resultCount}}</small> --> <!-- <small>{{ filter.resultCount}}</small> -->
...@@ -320,7 +317,7 @@ ...@@ -320,7 +317,7 @@
} }
}, },
'visibility': { 'visibility': {
'name': 'Veröffentlicht', 'name': 'Sichtbarkeit',
'hideInPublicSearch': true, 'hideInPublicSearch': true,
'filters': { 'filters': {
'vis_public': { 'vis_public': {
...@@ -483,6 +480,34 @@ ...@@ -483,6 +480,34 @@
*/ */
}, },
enableFilter: function(filter) {
filter.buttonState = !filter.buttonState
},
disableAllFilters: function() {
this.setAllFilters(true)
},
enableAllFilters: function() {
this.setAllFilters(false)
},
enableOnlyFilter: function(filter, filters) {
this.setAllFilters(false, filters)
this.enableFilter(filter)
},
setAllFilters: function(state, filters) {
if (filters) { // modify only the explicit set that was given
for (var elem in filters) {
filters[elem].buttonState = state
}
return
} else { // modify all the filters we have
for (var filterCategory in this.filterShow) {
for (var elem in this.filterShow[filterCategory].filters) {
this.filterShow[filterCategory].filters[elem].buttonState = state // TODO: check type of "state"
}
}
}
},
sortBy: function (key) { sortBy: function (key) {
this.sortKey = key this.sortKey = key
this.sortOrders[key] = this.sortOrders[key] * -1 this.sortOrders[key] = this.sortOrders[key] * -1
...@@ -499,12 +524,7 @@ ...@@ -499,12 +524,7 @@
this.getShibSessionData(); this.getShibSessionData();
if (this.getUrlParameter('filter') == 'none') { if (this.getUrlParameter('filter') == 'none') {
// disable all filters this.disableAllFilters()
for (var filterCategory in this.filterShow) {
for (var elem in this.filterShow[filterCategory].filters) {
this.filterShow[filterCategory].filters[elem].buttonState = true
}
}
} }
this.query = this.getUrlParameter('q') this.query = this.getUrlParameter('q')
if (this.query != '') { if (this.query != '') {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment