Sets sentence mode via a checkbox. #743.
This commit is contained in:
parent
d5799fb775
commit
46eeefea13
|
@ -300,7 +300,6 @@ export default {
|
||||||
},
|
},
|
||||||
setSentenceMode(sentenceMode) {
|
setSentenceMode(sentenceMode) {
|
||||||
this.$store.dispatch('search/setSentenceMode', sentenceMode);
|
this.$store.dispatch('search/setSentenceMode', sentenceMode);
|
||||||
this.updateURLQueries();
|
|
||||||
},
|
},
|
||||||
setSearchQuery(searchQuery) {
|
setSearchQuery(searchQuery) {
|
||||||
this.$store.dispatch('search/setSearchQuery', searchQuery);
|
this.$store.dispatch('search/setSearchQuery', searchQuery);
|
||||||
|
|
|
@ -149,9 +149,11 @@ export const setSearchQuery = ( state, searchQuery ) => {
|
||||||
|
|
||||||
export const setSentenceMode = ( state, sentenceMode ) => {
|
export const setSentenceMode = ( state, sentenceMode ) => {
|
||||||
if (sentenceMode == true)
|
if (sentenceMode == true)
|
||||||
state.postquery.sentence = sentenceMode;
|
Vue.set(state.postquery, 'sentence', sentenceMode);
|
||||||
else
|
else {
|
||||||
|
Vue.set(state.postquery, 'sentence', sentenceMode); // Needed to trigger getter
|
||||||
delete state.postquery.sentence;
|
delete state.postquery.sentence;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const setStatus = ( state, status ) => {
|
export const setStatus = ( state, status ) => {
|
||||||
|
|
|
@ -81,12 +81,17 @@
|
||||||
<b-dropdown-item
|
<b-dropdown-item
|
||||||
@click="updateSearch()"
|
@click="updateSearch()"
|
||||||
:focusable="false">
|
:focusable="false">
|
||||||
<span v-html="$i18n.get('instruction_press_enter_to_search_for')"/> "{{ futureSearchQuery }}".
|
<span v-html="$i18n.get('instruction_press_enter_to_search_for')"/>
|
||||||
|
<em>{{ sentenceMode == true ? futureSearchQuery : ('"' + futureSearchQuery + '"') }}.</em>
|
||||||
</b-dropdown-item>
|
</b-dropdown-item>
|
||||||
<b-dropdown-item
|
<b-dropdown-item
|
||||||
@click="$eventBusSearch.setSentenceMode(true)"
|
custom
|
||||||
:focusable="false">
|
:focusable="false">
|
||||||
{{ $i18n.get('label_use_search_separated_words') }}
|
<b-checkbox
|
||||||
|
:value="sentenceMode"
|
||||||
|
@input="$eventBusSearch.setSentenceMode($event)">
|
||||||
|
{{ $i18n.get('label_use_search_separated_words') }}
|
||||||
|
</b-checkbox>
|
||||||
<small class="is-small help">{{ $i18n.get('info_use_search_separated_words') }}</small>
|
<small class="is-small help">{{ $i18n.get('info_use_search_separated_words') }}</small>
|
||||||
</b-dropdown-item>
|
</b-dropdown-item>
|
||||||
<b-dropdown-item
|
<b-dropdown-item
|
||||||
|
@ -706,6 +711,9 @@
|
||||||
status() {
|
status() {
|
||||||
return this.getStatus();
|
return this.getStatus();
|
||||||
},
|
},
|
||||||
|
sentenceMode() {
|
||||||
|
return this.getSentenceMode();
|
||||||
|
},
|
||||||
adminViewMode() {
|
adminViewMode() {
|
||||||
const currentAdminViewMode = this.getAdminViewMode();
|
const currentAdminViewMode = this.getAdminViewMode();
|
||||||
return ['table', 'cards', 'records', 'grid', 'masonry', 'list'].indexOf(currentAdminViewMode) >= 0 ? currentAdminViewMode : 'table';
|
return ['table', 'cards', 'records', 'grid', 'masonry', 'list'].indexOf(currentAdminViewMode) >= 0 ? currentAdminViewMode : 'table';
|
||||||
|
@ -1590,7 +1598,7 @@
|
||||||
/deep/ .dropdown-menu {
|
/deep/ .dropdown-menu {
|
||||||
z-index: 99999991;
|
z-index: 99999991;
|
||||||
|
|
||||||
.dropdown-item:last-of-type {
|
.dropdown-item:last-child {
|
||||||
line-height: 2.25em;
|
line-height: 2.25em;
|
||||||
background: var(--tainacan-item-hover-background-color);
|
background: var(--tainacan-item-hover-background-color);
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,12 +91,17 @@
|
||||||
<b-dropdown-item
|
<b-dropdown-item
|
||||||
@click="updateSearch()"
|
@click="updateSearch()"
|
||||||
:focusable="false">
|
:focusable="false">
|
||||||
<span v-html="$i18n.get('instruction_press_enter_to_search_for')"/> "{{ futureSearchQuery }}".
|
<span v-html="$i18n.get('instruction_press_enter_to_search_for')"/>
|
||||||
|
<em>{{ sentenceMode == true ? futureSearchQuery : ('"' + futureSearchQuery + '"') }}.</em>
|
||||||
</b-dropdown-item>
|
</b-dropdown-item>
|
||||||
<b-dropdown-item
|
<b-dropdown-item
|
||||||
@click="$eventBusSearch.setSentenceMode(true)"
|
custom
|
||||||
:focusable="false">
|
:focusable="false">
|
||||||
{{ $i18n.get('label_use_search_separated_words') }}
|
<b-checkbox
|
||||||
|
:value="sentenceMode"
|
||||||
|
@input="$eventBusSearch.setSentenceMode($event)">
|
||||||
|
{{ $i18n.get('label_use_search_separated_words') }}
|
||||||
|
</b-checkbox>
|
||||||
<small class="is-small help">{{ $i18n.get('info_use_search_separated_words') }}</small>
|
<small class="is-small help">{{ $i18n.get('info_use_search_separated_words') }}</small>
|
||||||
</b-dropdown-item>
|
</b-dropdown-item>
|
||||||
<b-dropdown-item
|
<b-dropdown-item
|
||||||
|
@ -730,6 +735,9 @@
|
||||||
searchQuery() {
|
searchQuery() {
|
||||||
return this.getSearchQuery();
|
return this.getSearchQuery();
|
||||||
},
|
},
|
||||||
|
sentenceMode() {
|
||||||
|
return this.getSentenceMode();
|
||||||
|
},
|
||||||
viewMode() {
|
viewMode() {
|
||||||
return this.getViewMode();
|
return this.getViewMode();
|
||||||
},
|
},
|
||||||
|
@ -952,6 +960,7 @@
|
||||||
'getOrder',
|
'getOrder',
|
||||||
'getViewMode',
|
'getViewMode',
|
||||||
'getTotalItems',
|
'getTotalItems',
|
||||||
|
'getSentenceMode',
|
||||||
'getMetaKey',
|
'getMetaKey',
|
||||||
'getPage',
|
'getPage',
|
||||||
'getItemsPerPage'
|
'getItemsPerPage'
|
||||||
|
@ -1622,7 +1631,7 @@
|
||||||
/deep/ .dropdown-menu {
|
/deep/ .dropdown-menu {
|
||||||
z-index: 99999991;
|
z-index: 99999991;
|
||||||
|
|
||||||
.dropdown-item:last-of-type {
|
.dropdown-item:last-child {
|
||||||
line-height: 2.25em;
|
line-height: 2.25em;
|
||||||
background: var(--tainacan-item-hover-background-color);
|
background: var(--tainacan-item-hover-background-color);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue