Skip to content

Commit

Permalink
Add Link button to make URL out of search term
Browse files Browse the repository at this point in the history
  • Loading branch information
savage13 committed Dec 3, 2023
1 parent f709f1e commit 2d8d16b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/AppMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,16 @@ export default class AppMap extends mixins(MixinUtil) {
this.searchThrottler();
}

searchSetLink() {
const query = this.searchGetQuery();
this.$router.replace({
path: this.$route.fullPath,
query: {
q: query,
}
})
}

searchOnAdd() {
this.searchAddGroup(this.searchGetQuery());
this.searchQuery = '';
Expand Down
1 change: 1 addition & 0 deletions src/components/AppMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
<span v-show="this.searchResults.length >= this.MAX_SEARCH_RESULT_COUNT">Showing only the first {{MAX_SEARCH_RESULT_COUNT}} results.<br></span>
<b-btn size="sm" variant="link" @click="searchOnAdd"><i class="fa fa-plus"></i> Add to map</b-btn>
<b-btn size="sm" variant="link" @click="searchOnExclude"><i class="far fa-eye-slash"></i> Hide</b-btn>
<b-btn size="sm" variant="link" @click="searchSetLink"><i class="fas fa-link"></i> Link</b-btn>
</p>
<div v-for="(result, idx) in searchResults" :key="result.objid">
<ObjectInfo v-if="filterResults(result)" :obj="result" :is-static="false"
Expand Down

0 comments on commit 2d8d16b

Please sign in to comment.