client/js/main.js
changeset 78 af9e716b01bc
parent 75 7adef9ce92aa
child 79 f33771f3c510
equal deleted inserted replaced
77:4f2511a70880 78:af9e716b01bc
   162         var _tmpl = Rkns._.template('<li class="<%= className %>" data-key="<%= key %>"><%= title %></li>'),
   162         var _tmpl = Rkns._.template('<li class="<%= className %>" data-key="<%= key %>"><%= title %></li>'),
   163             _select = this.$.find(".Rk-Search-List"),
   163             _select = this.$.find(".Rk-Search-List"),
   164             _input = this.$.find(".Rk-Web-Search-Input")
   164             _input = this.$.find(".Rk-Web-Search-Input")
   165             _form = this.$.find(".Rk-Web-Search-Form");
   165             _form = this.$.find(".Rk-Web-Search-Form");
   166         Rkns._(_opts.search).each(function(_search, _key) {
   166         Rkns._(_opts.search).each(function(_search, _key) {
   167             var _searchObj = new _search.type(_this, _search);
   167         	console.log(_search, Rkns[_search.type]);
   168             _this.search_engines.push(_searchObj);
   168         	if (Rkns[_search.type] && Rkns[_search.type].Search) {
       
   169         		_this.search_engines.push(new Rkns[_search.type].Search(_this, _search));
       
   170         	}
   169         });
   171         });
       
   172         console.log(_this.search_engines);
   170         _select.html(
   173         _select.html(
   171             Rkns._(this.search_engines).map(function(_search, _key) {
   174             Rkns._(this.search_engines).map(function(_search, _key) {
   172                 return _tmpl({
   175                 return _tmpl({
   173                     key: _key,
   176                     key: _key,
   174                     title: _search.getSearchTitle(),
   177                     title: _search.getSearchTitle(),
   195             function() { _select.hide(); }
   198             function() { _select.hide(); }
   196         );
   199         );
   197         this.setSearchEngine(0);
   200         this.setSearchEngine(0);
   198     }
   201     }
   199     Rkns._(_opts.bins).each(function(_bin) {
   202     Rkns._(_opts.bins).each(function(_bin) {
   200         _this.tabs.push(new _bin.bin(_this, _bin));
   203     	if (Rkns[_bin.type] && Rkns[_bin.type].Bin) {
       
   204     		_this.tabs.push(new Rkns[_bin.type].Bin(_this, _bin));
       
   205     	}
   201     });
   206     });
   202     
   207     
   203     this.$.find(".Rk-Bins")
   208     this.$.find(".Rk-Bins")
   204         .on("click",".Rk-Bin-Title,.Rk-Bin-Title-Icon", function() {
   209         .on("click",".Rk-Bin-Title,.Rk-Bin-Title-Icon", function() {
   205             var _mainDiv = Rkns.$(this).siblings(".Rk-Bin-Main");
   210             var _mainDiv = Rkns.$(this).siblings(".Rk-Bin-Main");