diff --git a/web/javascript/torrent.js b/web/javascript/torrent.js
index a58292de3..6e715a37e 100644
--- a/web/javascript/torrent.js
+++ b/web/javascript/torrent.js
@@ -88,7 +88,7 @@ Torrent.prototype =
// insert the element
$('#torrent_list').append(this._element);
- this.initializeTorrentFilesInspectorGroup();
+ this.initializeTorrentFilesInspectorGroup(data.files.length);
for (var i = 0; i < data.files.length; i++) {
var file = data.files[i];
@@ -107,14 +107,12 @@ Torrent.prototype =
this.refresh(data);
},
- initializeTorrentFilesInspectorGroup: function() {
+ initializeTorrentFilesInspectorGroup: function(length) {
this._files = [];
- this._fileList = $('
').addClass('inspector_torrent_file_list').addClass('inspector_group').hide().
- append($('').addClass('inspector_group_label').append(
- $('').append(this.name())
- )
- );
- $('#inspector_file_list').append(this._fileList);
+ this._fileList = $('').addClass('inspector_torrent_file_list').addClass('inspector_group').hide();
+ if(length == 1)
+ this._fileList.addClass('single_file');
+ $('#inspector_file_list').append(this._fileList);
},
fileList: function() {
@@ -672,7 +670,7 @@ TorrentFile.prototype = {
},
setPriority: function(priority) {
- if(this.element().hasClass('complete'))
+ if(this.element().hasClass('complete') || this._torrent._files.length == 1)
return;
var priority_level = { high: 1, normal: 0, low: -1 }[priority];
if (this._prio == priority_level) { return; }
@@ -696,7 +694,7 @@ TorrentFile.prototype = {
},
toggleWanted: function() {
- if(this.element().hasClass('complete'))
+ if(this.element().hasClass('complete') || this._torrent._files.length == 1)
return;
this.setWanted(!this._wanted);
},
diff --git a/web/stylesheets/common.css b/web/stylesheets/common.css
index 332f8c4b7..b632ceae3 100644
--- a/web/stylesheets/common.css
+++ b/web/stylesheets/common.css
@@ -645,6 +645,7 @@ li.inspector_torrent_file_list_entry.complete>.file_wanted_control {
background-position: left -19px;
}
+ul.single_file li.inspector_torrent_file_list_entry>.file_wanted_control,
li.inspector_torrent_file_list_entry.complete>.file_wanted_control {
background-position: left -38px;
cursor: default;
@@ -678,8 +679,8 @@ div.file_priority_control.low {
div.file_priority_control.low:hover {
background-position: right -38px;
}
-li.inspector_torrent_file_list_entry.complete div.file_priority_control,
-li.inspector_torrent_file_list_entry.complete div.file_priority_control:hover {
+ul.single_file li.inspector_torrent_file_list_entry>.file_priority_control,
+li.inspector_torrent_file_list_entry.complete div.file_priority_control {
background-position: left -57px;
cursor: default;
}