Skip to content

Commit a381b43

Browse files
committed
delay to setup search box
1 parent ec91bff commit a381b43

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed
Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
(function(google) {
22
'use strict';
33

4-
google.load("search", "1", {language : "ja"});
5-
google.setOnLoadCallback(function() {
6-
// search
7-
var customSearchControl = new google.search.CustomSearchControl("001325159752250591701:65aunpq8rlg");
8-
customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
9-
var options = new google.search.DrawOptions();
10-
options.enableSearchboxOnly("//www.google.com/cse?cx=001325159752250591701:65aunpq8rlg");
11-
customSearchControl.draw('VimdocJaSearch', options);
12-
}, true);
4+
google.load("search", "1", {
5+
language : "ja",
6+
callback: function() {
7+
google.setOnLoadCallback(function() {
8+
// search
9+
var customSearchControl = new google.search.CustomSearchControl("001325159752250591701:65aunpq8rlg");
10+
customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
11+
var options = new google.search.DrawOptions();
12+
options.enableSearchboxOnly("//www.google.com/cse?cx=001325159752250591701:65aunpq8rlg");
13+
customSearchControl.draw('VimdocJaSearch', options);
14+
}, true);
15+
}
16+
});
1317
})(google);

0 commit comments

Comments
 (0)