forked from rDrama/rDrama
add javascript and css for non-click-sortable table headers th (#107)
I noticed there are some over-interactive tables in general on rdrama. Particularly, multiple columns in the shop tables (awards and hats), which allow you to sort by buttons, icons, … The one page for user profile views also comes to mind, because it uses relative time since last visit, is paged server-side and browsers do not know how to sort that type of data anyway. Also I noticed there are some tables that have disabled sorting by using <td> instead of <th> for the headers as is the case of the following pages: * @uid/followed * @uid/following All of these situations are accounted for but need to be changed later in a different PR, because I can't right now. For example, the "Buy" column of the shop can be changed to the following to disable sorting: `<th class="disable-sort-click">Buy</th>` Reviewed-on: rDrama/rDrama#107 Co-authored-by: mummified-corroding-granny <mummified-corroding-granny@noreply.fsdfsd.net> Co-committed-by: mummified-corroding-granny <mummified-corroding-granny@noreply.fsdfsd.net>master
parent
23c11fa7b7
commit
3a3e1d8d74
|
@ -5120,6 +5120,10 @@ code {
|
|||
cursor: pointer !important;
|
||||
}
|
||||
|
||||
.disable-sort-click {
|
||||
cursor: default !important;
|
||||
}
|
||||
|
||||
lite-youtube {
|
||||
background-color: #000;
|
||||
position: relative;
|
||||
|
|
|
@ -548,6 +548,9 @@ if (reload_page) {
|
|||
|
||||
const TH = document.getElementsByTagName('th')
|
||||
for (const element of TH) {
|
||||
if (element.classList.contains("disable-sort-click"))
|
||||
continue;
|
||||
|
||||
element.addEventListener('click', () => {sort_table(element)});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue