Skip to content
This repository was archived by the owner on Jan 8, 2019. It is now read-only.

Commit c18f7c7

Browse files
author
Jochen Schalanda
committed
Only append width query parameter if it has a value, refs Graylog2/graylog2-server#696
1 parent e168811 commit c18f7c7

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

app/assets/javascripts/universalsearch.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,15 @@ $(document).ready(function() {
166166

167167
var container = $(this).closest(".saved-searches-selector-container");
168168
if(!!container.attr("data-stream-id")) {
169-
var url = "/savedsearches/" + encodeURI(searchId) + "/execute?" + "streamId=" + container.attr("data-stream-id") + "&width=" + width;
169+
var url = "/savedsearches/" + encodeURI(searchId) + "/execute?" + "streamId=" + container.attr("data-stream-id");
170+
if(width != null && width != '') {
171+
url += "&width=" + width;
172+
}
170173
} else {
171-
var url = "/savedsearches/" + encodeURI(searchId) + "/execute" + "?width=" + width;
174+
var url = "/savedsearches/" + encodeURI(searchId) + "/execute";
175+
if(width != null && width != '') {
176+
url += "?width=" + width;
177+
}
172178
}
173179

174180
window.location = appPrefixed(url);
@@ -223,4 +229,4 @@ function activateTimerangeChooser(selectorName, link) {
223229

224230
$("a", link.parent().parent()).removeClass("selected");
225231
link.addClass("selected");
226-
}
232+
}

app/views/partials/universalsearch.scala.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
value="@if(request.getQueryString("rangetype") == null) {relative} else {@request.getQueryString("rangetype")}"
1212
id="universalsearch-rangetype" />
1313
<input type="hidden" name="fields" id="universalsearch-fields" value="" />
14-
<input type="hidden" name="width">
14+
<input type="hidden" name="width" value="-1" />
1515

1616
@*** Those are never changed by JS and can be read by methods that need the *original* information. ***@
1717
@if(request.getQueryString("rangetype") != null && !request.getQueryString("rangetype").isEmpty) {

0 commit comments

Comments
 (0)