Commit 707a417b authored by Piotr Gawron's avatar Piotr Gawron
Browse files

restoring by search query refactored

parent 246fd3d6
......@@ -44,6 +44,15 @@ function processUrlGetParams(params) {
}
function restoreSearchQuery(customMap) {
var query = ServerConnector.getSessionData().getSearchQuery();
if (query!==undefined) {
return customMap.getOverlayByName("search").searchByEncodedQuery(query);
} else {
return Promise.resolve();
}
};
function create(params) {
if (global.GuiConnector === undefined) {
global.GuiConnector = OriginalGuiConnector;
......@@ -115,11 +124,8 @@ function create(params) {
return new Promise(function(resolve, reject) {
var sessionData =ServerConnector.getSessionData();
result.refreshOverlays().then(function() {
if (sessionData.getSearchQuery()!==undefined) {
return result.getOverlayByName("search").searchByEncodedQuery(sessionData.getSearchQuery());
} else {
return Promise.resolve();
}}).then(function(){
return restoreSearchQuery(result);
}).then(function(){
if (ServerConnector.getSessionData().getShowComments()) {
result.getControl(ControlType.COMMENT_CHECKBOX).checked=true;
......
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