1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-02-02 09:55:55 +00:00

Use fake tristate checkbox on IE < 9 only

This commit is contained in:
Gabriele 2014-11-04 22:00:00 +01:00
parent 92cc8f7211
commit fa706b24be
2 changed files with 37 additions and 18 deletions

View File

@ -275,7 +275,7 @@ a.propButton img {
}
/* Tri-state checkbox */
a.tristate {
label.tristate {
background: url(../images/3-state-checkbox.gif) 0 0 no-repeat;
display: block;
float: left;
@ -285,8 +285,8 @@ a.tristate {
text-indent: -999em;
width: 13px;
}
a.checked { background-position: 0 -13px; }
a.partial { background-position: 0 -26px; }
label.checked { background-position: 0 -13px; }
label.partial { background-position: 0 -26px; }
fieldset.settings {
border: solid 1px black;

View File

@ -2,7 +2,7 @@
<table class="torrentTable" cellpadding="0" cellspacing="0" style="width: 100%">
<thead>
<tr>
<th style="width: 30px"><a id="all_files_cb" style="margin-right: 2px;" class="tristate" onclick="javascript:switchCBState()"></a></th>
<th style="width: 30px"><input type="checkbox" id="tristate_cb" style="display: none;" onclick="javascript:switchCBState()" /><label id="all_files_cb" class="tristate" for="tristate_cb"></label></th>
<th>_(Name)</th>
<th>_(Size)</th>
<th style="width: 90px;">_(Progress)</th>
@ -18,23 +18,42 @@
var is_seed = true;
var current_hash = "";
var setCBState = function(state) {
if(state == "partial") {
if(!$("all_files_cb").hasClass("partial")) {
$("all_files_cb").removeClass("checked");
$("all_files_cb").addClass("partial");
}
return;
}
if(state == "checked") {
if(!$("all_files_cb").hasClass("checked")) {
if (!(Browser.name == "ie" && Browser.version < 9)) {
$("all_files_cb").removeClass("tristate");
$("all_files_cb").removeClass("partial");
$("all_files_cb").addClass("checked");
$("all_files_cb").removeClass("checked");
$("tristate_cb").style.display = "inline";
}
var setCBState = function(state) {
if (Browser.name == "ie" && Browser.version < 9) {
if (state == "partial") {
if (!$("all_files_cb").hasClass("partial")) {
$("all_files_cb").removeClass("checked");
$("all_files_cb").addClass("partial");
}
return;
}
if (state == "checked") {
if(!$("all_files_cb").hasClass("checked")) {
$("all_files_cb").removeClass("partial");
$("all_files_cb").addClass("checked");
}
return;
}
$("all_files_cb").removeClass("partial");
$("all_files_cb").removeClass("checked");
} else {
if (state == "partial") {
$("tristate_cb").indeterminate = true;
} else if (state == "checked") {
$("tristate_cb").indeterminate = false;
$("tristate_cb").checked = true;
} else {
$("tristate_cb").indeterminate = false;
$("tristate_cb").checked = false;
}
return;
}
$("all_files_cb").removeClass("partial");
$("all_files_cb").removeClass("checked");
}
var switchCBState = function() {