Skip to content
Snippets Groups Projects
Verified Commit 9922ce00 authored by Isabella Skořepová's avatar Isabella Skořepová
Browse files

Fix search results opening in new tab

fixes #17
parent 2396a483
No related branches found
No related tags found
No related merge requests found
......@@ -31,18 +31,25 @@
};
};
var csc;
var myCallback = function() {
var doRender = function() {
var csc = new google.search.CustomSearchControl;
.setLinkTarget (google.search.Search.LINK_TARGET_SELF);
google.search.cse.element.render({
div: "searchresults",
tag: 'searchresults-only',
gname: 'searchresults'
});
var options = {};
options[google.search.Search.RESTRICT_EXTENDED_ARGS] = {
'as_sitesearch': 'nove.ok1kvk.cz'
};
csc = new google.search.CustomSearchControl('003089460452505374651:q5prtsadbio', options);
csc.setLinkTarget (google.search.Search.LINK_TARGET_SELF);
var drawOptions = new google.search.DrawOptions();
drawOptions.enableSearchResultsOnly();
csc.draw("searchresults", drawOptions);
var s = $("#searchbox input").val()
if(s != "")
google.search.cse.element.getElement('searchresults').execute(s);
csc.execute(s);
}
if (document.readyState == 'complete') {
doRender();
......@@ -74,7 +81,7 @@
$("#searchresults").html("");
myCallback();
} else
google.search.cse.element.getElement('searchresults').execute(s);
csc.execute(s);
},250));
(function() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment