Issue#8105: Make tool favourite query a toggle - The favourite button has been changed to toggle between clearing the search and showing the favourites

This commit is contained in:
janani
2019-07-13 16:27:21 +02:00
parent c0e2e1a200
commit aaf9aa7fa4
@@ -52,9 +52,21 @@ const ToolPanel = Backbone.View.extend({
title: _l("Show favorites"),
icon: "fa fa-star-o",
onclick: e => {
$("#tool-search-query")
.val("#favorites")
.trigger("change");
$(".panel-header-button .fa").toggleClass("fa-star-o fa-star");
//hide the tooltip
$(".panel-header-button").tooltip('hide');
if($("#tool-search-query").val().indexOf("#favorites")!= -1)
{
$("#tool-search-query").val("");
$("#tool-search-query").keyup();
$(".panel-header-button").attr("title","");
}
else
{
$("#tool-search-query")
.val("#favorites")
.trigger("change");
}
}
});
panel_buttons.push(this.favorite_button);