- autocomplete search, default full text search
This commit is contained in:
parent
38b8973f02
commit
f749b2eb3e
7 changed files with 418 additions and 430 deletions
|
@ -28,7 +28,7 @@
|
|||
<!-- <router-link class="navbar-link is-arrowless" to="/services">SERVICES</router-link> -->
|
||||
</li>
|
||||
<li class="navbar-item">
|
||||
<a class="navbar-link is-arrowless" bind:href="help_url">HELP</a>
|
||||
<a class="navbar-link is-arrowless" v-bind:href="help_url">HELP</a>
|
||||
<!-- <router-link class="navbar-link is-arrowless" to="/help">HELP</router-link> -->
|
||||
</li>
|
||||
<!-- <li class="navbar-item">
|
||||
|
@ -38,7 +38,7 @@
|
|||
<a class="navbar-link is-arrowless" href="#">HELP</a>
|
||||
</li> -->
|
||||
<li class="navbar-item">
|
||||
<a class="navbar-link is-arrowless" bind:href="oai_url">OAI</a>
|
||||
<a class="navbar-link is-arrowless" v-bind:href="oai_url">OAI</a>
|
||||
<!-- <router-link target="_blank" class="navbar-link is-arrowless" to="/oai">OAI</router-link> -->
|
||||
</li>
|
||||
<!--
|
||||
|
|
|
@ -3,7 +3,7 @@ import { Options, Vue } from "vue-class-component";
|
|||
import { Prop } from "vue-property-decorator";
|
||||
import { LatLng, LatLngBounds, Map, MapOptions, Rectangle, tileLayer, TileLayer, CRS } from "leaflet";
|
||||
// import { LayerOptions } from "./map-options";
|
||||
import DatasetService from "../../services/dataset.service";
|
||||
// import DatasetService from "../../services/dataset.service";
|
||||
import { Subscription } from "rxjs";
|
||||
import { OaiDataset } from "@/models/oai";
|
||||
|
||||
|
|
|
@ -29,8 +29,8 @@ export default class VsInput extends Vue {
|
|||
private error = "";
|
||||
private results: Array<Dataset> = [];
|
||||
private loading = false;
|
||||
private selectedIndex = 0;
|
||||
private selectedDisplay = "";
|
||||
private selectedIndex = -1;
|
||||
// private selectedDisplay = "";
|
||||
private solr: SolrSettings = {
|
||||
core: SOLR_CORE, //"rdr_data", // SOLR.core;
|
||||
host: SOLR_HOST, //"tethys.at",
|
||||
|
@ -132,7 +132,7 @@ export default class VsInput extends Vue {
|
|||
}
|
||||
|
||||
searchChanged(): void {
|
||||
this.selectedIndex = 0;
|
||||
this.selectedIndex = -1;
|
||||
// Let's warn the parent that a change was made
|
||||
// this.$emit("input", this.display);
|
||||
if (this.display.length >= 2) {
|
||||
|
@ -183,7 +183,7 @@ export default class VsInput extends Vue {
|
|||
|
||||
onArrowDown(ev: Event): void {
|
||||
ev.preventDefault();
|
||||
if (this.selectedIndex === null) {
|
||||
if (this.selectedIndex === -1) {
|
||||
this.selectedIndex = 0;
|
||||
return;
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ export default class VsInput extends Vue {
|
|||
|
||||
onArrowUp(ev: Event): void {
|
||||
ev.preventDefault();
|
||||
if (this.selectedIndex === null) {
|
||||
if (this.selectedIndex === -1) {
|
||||
this.selectedIndex = this.suggestions.length - 1;
|
||||
return;
|
||||
}
|
||||
|
@ -211,11 +211,13 @@ export default class VsInput extends Vue {
|
|||
}
|
||||
|
||||
onEnter(): void {
|
||||
if (this.selectedIndex === null) {
|
||||
if (this.selectedIndex === -1) {
|
||||
// this.$emit("nothingSelected", this.display);
|
||||
return;
|
||||
this.display && this.search();
|
||||
} else {
|
||||
this.select(this.suggestions[this.selectedIndex]);
|
||||
}
|
||||
this.select(this.suggestions[this.selectedIndex]);
|
||||
|
||||
// this.$emit("enter", this.display);
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,8 @@
|
|||
@keydown.tab="close"
|
||||
v-on:focus="focus"
|
||||
/>
|
||||
<!-- <p>Message is: {{ display }}</p> v-on:input="searchChanged"-->
|
||||
<!-- <p>Display is: {{ display }}</p> -->
|
||||
<!-- v-on:input="searchChanged" -->
|
||||
</div>
|
||||
|
||||
<div class="control">
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue