only 1 disk will not display drag to sort table

pull/181/head
qkqpttgf 2020-12-29 19:07:17 +08:00 committed by GitHub
parent 6b5c26b897
commit 67da665f11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -1915,8 +1915,8 @@ function EnvOpt($needUpdate = 0)
<tr><td><input type="submit" name="submit1" value="'.getconstStr('Setup').'"></td></tr> <tr><td><input type="submit" name="submit1" value="'.getconstStr('Setup').'"></td></tr>
</form> </form>
</table><br>'; </table><br>';
$disktags = getConfig('disktag'); $disktags = explode('|', getConfig('disktag'));
if ($disktags!='') { if (count($disktags)>1) {
$html .= ' $html .= '
<script src="//cdn.bootcss.com/Sortable/1.8.3/Sortable.js"></script> <script src="//cdn.bootcss.com/Sortable/1.8.3/Sortable.js"></script>
<style> <style>
@ -1934,7 +1934,7 @@ function EnvOpt($needUpdate = 0)
<tr id="sortdisks"> <tr id="sortdisks">
<input type="hidden" name="disktag_sort" value="">'; <input type="hidden" name="disktag_sort" value="">';
$num = 0; $num = 0;
foreach (explode("|", $disktags) as $disktag) { foreach ($disktags as $disktag) {
if ($disktag!='') { if ($disktag!='') {
$num++; $num++;
$html .= ' $html .= '
@ -1947,7 +1947,7 @@ function EnvOpt($needUpdate = 0)
</form> </form>
</table> </table>
<script> <script>
var disks=' . json_encode(explode("|", $disktags)) . '; var disks=' . json_encode($disktags) . ';
function change(arr, oldindex, newindex) { function change(arr, oldindex, newindex) {
//console.log(oldindex + "," + newindex); //console.log(oldindex + "," + newindex);
tmp=arr.splice(oldindex-1, 1); tmp=arr.splice(oldindex-1, 1);
@ -1991,7 +1991,7 @@ function EnvOpt($needUpdate = 0)
}); });
</script><br>'; </script><br>';
} }
foreach (explode("|", $disktags) as $disktag) { foreach ($disktags as $disktag) {
if ($disktag!='') { if ($disktag!='') {
$html .= ' $html .= '
<table border=1 width=100%> <table border=1 width=100%>