Code layout change.
[wolnelektury.git] / src / wolnelektury / static / js / widget_run.js
1 var s = $('#id_qq');
2 var url = s.attr('data-source');
3 s.search({
4     source: function(req, cb) {
5         $.ajax({url: url,
6             dataType: "jsonp",
7             data: {term: req.term},
8             type: "GET",
9             success: function(data) {cb(data);},
10             error: function() {cb([]);}
11         });
12     },
13     dataType: "jsonp",
14     select: function(event, ui) {
15         if (ui.item.url != undefined) {
16             window.top.location.href = '//wolnelektury.pl' + ui.item.url;
17         } else {
18             $('form').submit();
19         }
20     },
21     position: {
22         my: "center bottom",
23         at: "center bottom",
24         of: "#wl a"
25     },
26 });