Match search word with description

This commit is contained in:
guerler
2018-03-01 18:26:30 -05:00
parent 923286612d
commit a077f45ba9
@@ -6,7 +6,7 @@
<div class="ui-thumbnails-grid">
<input class="search-query parent-width" name="query" placeholder="search visualizations" autocomplete="off" type="text" v-model="search">
<div v-for="plugin in plugins">
<table v-if="!search || plugin.name.indexOf(search) != -1">
<table v-if="match(plugin)">
<tr class="ui-thumbnails-item" @click="select(plugin)">
<td>
<img v-if="plugin.logo" class="ui-thumbnails-image" :src="plugin.logo"/>
@@ -92,6 +92,11 @@ export default {
let href = `${Galaxy.root}plugins/visualizations/${plugin.name}/show?dataset_id=${this.selected}`;
$("#galaxy_main").attr("src", href);
},
match: function(plugin) {
return !this.search ||
plugin.name.indexOf(this.search) != -1 ||
(plugin.description && plugin.description.indexOf(this.search) != -1);
},
_errorMessage: function(e) {
let message = e && e.response && e.response.data && e.response.data.err_msg;
return message || "Request failed for unkown reason.";