]> granicus.if.org Git - transmission/commitdiff
(trunk, web) #5091 'Disable file selection for non-multi-file transfers' -- fixed.
authorJordan Lee <jordan@transmissionbt.com>
Mon, 15 Oct 2012 04:32:48 +0000 (04:32 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Mon, 15 Oct 2012 04:32:48 +0000 (04:32 +0000)
web/javascript/file-row.js

index 1e4a2fb89e0649afe5c2e7676019b7d01ac8d744..307cd9cdcdabe31a087de72ce5daf7eac89958b0 100644 (file)
@@ -38,6 +38,7 @@ function FileRow(torrent, depth, name, indices, even)
                var e = $(elements.root);
                e.toggleClass('skip', !fields.isWanted);
                e.toggleClass('complete', isDone());
+               $(e[0].checkbox).prop('disabled', !isEditable());
                $(e[0].checkbox).prop('checked', fields.isWanted);
        },
        refreshProgressHTML = function()
@@ -104,6 +105,9 @@ function FileRow(torrent, depth, name, indices, even)
        isDone = function () {
                return fields.have >= fields.size;
        },
+       isEditable = function () {
+               return (fields.torrent.getFileCount()>1) && !isDone();
+       };
 
        createRow = function(torrent, depth, name, even) {
                var e, root, box;
@@ -182,9 +186,6 @@ function FileRow(torrent, depth, name, indices, even)
        this.getElement = function() {
                return elements.root;
        };
-       this.isEditable = function () {
-               return (fields.torrent.getFileCount()>1) && !isDone();
-       };
        this.refresh = function() {
                refreshImpl();
        };