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() { ...@@ -24,7 +24,7 @@ Search.prototype.init = function() {
this.initComponents(); this.initComponents();
this.bindEvents(); this.bindEvents();
__translator.getTranslations(search.queryHandler.doSearchDelayed()); __translator.getTranslations(search.queryHandler.doSearchDelayed(true));
}; };
Search.prototype.bindEvents = function() { Search.prototype.bindEvents = function() {
......
...@@ -161,7 +161,7 @@ QueryHandler.prototype.removeSearchFacet = function(control) { ...@@ -161,7 +161,7 @@ QueryHandler.prototype.removeSearchFacet = function(control) {
this.reorderFacets(); this.reorderFacets();
}; };
QueryHandler.prototype.doSearch = function(isShowMore) { QueryHandler.prototype.doSearch = function(isShowMore, initSearch) {
if (isShowMore===null || isShowMore===undefined) { if (isShowMore===null || isShowMore===undefined) {
isShowMore=false; isShowMore=false;
} }
...@@ -174,6 +174,12 @@ QueryHandler.prototype.doSearch = function(isShowMore) { ...@@ -174,6 +174,12 @@ QueryHandler.prototype.doSearch = function(isShowMore) {
var _this = this; var _this = this;
if (this.query!==null) { if (this.query!==null) {
$("#search-loading-indicator").removeClass("fade"); $("#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({ $.ajax({
url: __util.getBaseUrl() + "query/", url: __util.getBaseUrl() + "query/",
type: "POST", type: "POST",
...@@ -196,16 +202,16 @@ QueryHandler.prototype.doSearch = function(isShowMore) { ...@@ -196,16 +202,16 @@ QueryHandler.prototype.doSearch = function(isShowMore) {
}; };
QueryHandler.prototype.doSearchDelayed = function() { QueryHandler.prototype.doSearchDelayed = function(initSearch) {
var ts = new Date(); var ts = new Date();
search.queryHandler.lastDelayedQueryTs = ts; 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) { if (timestamp===this.lastDelayedQueryTs) {
this.lastDelayedQueryTs = null; 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