diff -r 9b9aabbb83bb -r 48d825187d67 client/js/main.js --- a/client/js/main.js Fri Sep 14 10:21:00 2012 +0900 +++ b/client/js/main.js Tue Nov 13 11:46:27 2012 +0100 @@ -36,13 +36,25 @@ this.title_icon_$ = Rkns.$('') .addClass("Rk-Bin-Title-Icon") .appendTo(this.$); + var _this = this; - Rkns.$('') + + Rkns.$('') + .attr("href","#") .addClass("Rk-Bin-Close") .html('×') .appendTo(this.$) .click(function() { _this.destroy(); + return false; + }); + Rkns.$('') + .attr("href","#") + .addClass("Rk-Bin-Refresh") + .appendTo(this.$) + .click(function() { + _this.refresh(); + return false; }); this.title_$ = Rkns.$('

') .addClass("Rk-Bin-Title") @@ -52,6 +64,12 @@ .appendTo(this.$); this.title_$.html(_opts.title || '(new bin)'); this.renkan.resizeBins(); + + if (_opts.auto_refresh) { + window.setInterval(function() { + _this.refresh(); + },_opts.auto_refresh) + } } } @@ -133,22 +151,7 @@ } Rkns._(_opts.bins).each(function(_bin) { _this.tabs.push(new _bin.bin(_this, _bin)); - }) - - /* The bins are not yet populated, but we want to bind dragging functions - * here, as it will be easier than in the bins. Therefore, we bind to Rk-Bins - * and look where the click was. */ - function findItem(_event) { - var _t = Rkns.$(_event.target); - while (!_t.is(".Rk-Bins,.Rk-Bin-Item")) { - _t = _t.parent(); - } - if (_t.is(".Rk-Bin-Item")) { - return _t - } else { - return null; - } - } + }); this.$.find(".Rk-Bins") .on("click",".Rk-Bin-Title,.Rk-Bin-Title-Icon", function() {