Commit 72dbbe25 authored by Gradl, Tobias's avatar Gradl, Tobias
Browse files

423: Implement GET with search parameters (OPENED)

Task-Url: search#423
parent b8d42adc
......@@ -24,7 +24,7 @@ Search.prototype.init = function() {
this.initComponents();
this.bindEvents();
__translator.getTranslations(search.queryHandler.doSearchDelayed());
__translator.getTranslations(search.queryHandler.doSearchDelayed(true));
};
Search.prototype.bindEvents = function() {
......
......@@ -161,7 +161,7 @@ QueryHandler.prototype.removeSearchFacet = function(control) {
this.reorderFacets();
};
QueryHandler.prototype.doSearch = function(isShowMore) {
QueryHandler.prototype.doSearch = function(isShowMore, initSearch) {
if (isShowMore===null || isShowMore===undefined) {
isShowMore=false;
}
......@@ -174,6 +174,12 @@ QueryHandler.prototype.doSearch = function(isShowMore) {
var _this = this;
if (this.query!==null) {
$("#search-loading-indicator").removeClass("fade");
// Leave notifications in place for first execution of search
if (initSearch!==true) {
$("#search-notifications-container").hide();
$("#search-notifications-container").text("");
}
$.ajax({
url: __util.getBaseUrl() + "query/",
type: "POST",
......@@ -196,16 +202,16 @@ QueryHandler.prototype.doSearch = function(isShowMore) {
};
QueryHandler.prototype.doSearchDelayed = function() {
QueryHandler.prototype.doSearchDelayed = function(initSearch) {
var ts = new Date();
search.queryHandler.lastDelayedQueryTs = ts;
setTimeout(function() { search.queryHandler.delaySearch(ts); }, 1000);
setTimeout(function() { search.queryHandler.delaySearch(ts, initSearch); }, 1000);
};
QueryHandler.prototype.delaySearch = function(timestamp) {
QueryHandler.prototype.delaySearch = function(timestamp, initSearch) {
if (timestamp===this.lastDelayedQueryTs) {
this.lastDelayedQueryTs = null;
this.doSearch();
this.doSearch(false, initSearch);
}
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment