]> granicus.if.org Git - transmission/commitdiff
(trunk web) #4452 "stop/start toggle button doesn't work properly on Chrome 13" ...
authorJordan Lee <jordan@transmissionbt.com>
Wed, 31 Aug 2011 04:39:24 +0000 (04:39 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Wed, 31 Aug 2011 04:39:24 +0000 (04:39 +0000)
web/javascript/transmission.js

index 953ab0318d1816705618bd04e1a014577c7ffbfd..7a917d714b0d1af8cadbb6eb824316e4dc534d03 100644 (file)
@@ -1096,6 +1096,18 @@ Transmission.prototype =
 
        onRowClicked: function(ev, row)
        {
+               // handle the per-row "torrent_resume" button
+               if (ev.target.className === 'torrent_resume') {
+                       this.startTorrent(row.getTorrent());
+                       return;
+               }
+
+               // handle the per-row "torrent_pause" button
+               if (ev.target.className === 'torrent_pause') {
+                       this.stopTorrent(row.getTorrent());
+                       return;
+               }
+
                // Prevents click carrying to parent element
                // which deselects all on click
                ev.stopPropagation();
@@ -1342,20 +1354,6 @@ Transmission.prototype =
        ****
        ***/
 
-       onToggleRunningClicked: function(ev)
-       {
-               var t, i, e;
-               e = $(ev.target).closest('.torrent')[0];
-               i = $('#torrent_list > li').index(e);
-               if ((0<=i) && (i<this._rows.length)) {
-                       t = this._rows[i].getTorrent();
-                       if (t.isStopped())
-                               this.startTorrent(t);
-                       else
-                               this.stopTorrent(t);
-               }
-       },
-
        setEnabled: function(key, flag)
        {
                $(key).toggleClass('disabled', !flag);
@@ -1926,8 +1924,10 @@ Transmission.prototype =
 
        refilterSoon: function()
        {
-               if (!this.refilterTimer)
-                       this.refilterTimer = setTimeout($.proxy(this.refilter,this), 100);
+               if (!this.refilterTimer) {
+                       var tr = this;
+                       this.refilterTimer = setTimeout(function(){tr.refilter(false);}, 100);
+               }
        },
 
        sortRows: function(rows)
@@ -2008,8 +2008,6 @@ Transmission.prototype =
                                row = new TorrentRow(renderer, this, t);
                                row.getElement().row = row;
                                dirty_rows.push(row);
-                               if ((e = row.getToggleRunningButton()))
-                                       $(e).click($.proxy(this.onToggleRunningClicked,this));
                        }
                }