From 68780a6652e5ced0a6ea00f57ae2c532efd83bb7 Mon Sep 17 00:00:00 2001 From: kilo Date: Mon, 17 Jul 2017 22:05:24 +0200 Subject: [PATCH] better background color for mod tools, torrents don't move around when you show the checkboxes :baby_chick:, fix auto-updating JS for mods (#1224) * preliminary CSS work * only apply button rule to #show_actions * forgot the JS * fix auto-updating for mods * woops wrong file * there --- public/css/main.css | 6 +++++- public/js/torrentsMod.js | 6 ++++-- templates/layouts/partials/torrent_item.jet.html | 10 ++++------ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/public/css/main.css b/public/css/main.css index 9a187c00..588c2082 100644 --- a/public/css/main.css +++ b/public/css/main.css @@ -728,7 +728,7 @@ input.filelist-checkbox:checked + table.table-filelist { padding: 5px 10px; max-width: 1060px; width: 100%; - background: #e6eff4; + background-color: #F7F8F9; border: 1px solid #cbbdd7; height: 50px; border-radius: 5px; @@ -746,6 +746,10 @@ input.filelist-checkbox:checked + table.table-filelist { .modtools .cb_action, .toolbar .cb_action { height: 100%; } +.modtools #show_actions { margin-top: 4px; } +.mod-open .tr-cat { width: 73px; } +.mod-open .th, .mod-open .home-td, .mod-open .user-td { padding: 2px 2px; } + /* Modal box */ /* The Modal (background) */ .modal { diff --git a/public/js/torrentsMod.js b/public/js/torrentsMod.js index 5e20d807..e597fedd 100644 --- a/public/js/torrentsMod.js +++ b/public/js/torrentsMod.js @@ -53,8 +53,10 @@ var TorrentsMod = { var divActions = this.nextElementSibling; if (divActions.style.display == "inline") { TorrentsMod.enabled = false; - } else { - TorrentsMod.enabled = true; + document.getElementsByClassName("results box mod-open")[0].className = "results box"; + } else { + TorrentsMod.enabled = true; + document.getElementsByClassName("results box")[0].className = "results box mod-open"; } divActions.style.display = (TorrentsMod.enabled) ? "inline" : "none"; var td_cbs = document.getElementsByClassName("tr-cb") diff --git a/templates/layouts/partials/torrent_item.jet.html b/templates/layouts/partials/torrent_item.jet.html index b25a8676..c5ece5d7 100644 --- a/templates/layouts/partials/torrent_item.jet.html +++ b/templates/layouts/partials/torrent_item.jet.html @@ -10,7 +10,7 @@ T.Add("{{ language.Tag }}", "{{ LanguageName(language, T) }}") Templates.Add("torrents.item", function(torrent) { return ""+ {{ if User.HasAdmin() }} - ""+ + (( TorrentsMod.enabled ) ? "" : "")+ ""+ ""+ {{ end }} @@ -24,10 +24,8 @@ Templates.Add("torrents.item", function(torrent) { ((torrent.languages[0] != "") ? "" : "") + ""+ ""+ - ""+Templates.EncodeEntities(torrent.name) +""+ - ""+ - ((torrent.comments.length > 0) ? "" + torrent.comments.length + "" : "")+ - ""+ + ""+Templates.EncodeEntities(torrent.name) +""+ + ((torrent.comments.length > 0) ? ""+ torrent.comments.length + "" : "")+ ""+ ""+ "
"+ @@ -39,4 +37,4 @@ Templates.Add("torrents.item", function(torrent) { ""+torrent.completed+""+ ""+torrent.date+""+ ""; -}); \ No newline at end of file +});