rename gobal functin sortt_f to sortt and update Readme
This commit is contained in:
parent
9dcc74c22f
commit
d678f2bd02
@ -4,7 +4,7 @@ Java Script for https://github.com/go-gitea/gitea/pull/7980 (Sortable Tables) ..
|
|||||||
|
|
||||||
|
|
||||||
## Routine Idear
|
## Routine Idear
|
||||||
1. if table head colum class has attribute sort="xy" -> colum header klickable
|
1. add to table head colum onclick="sortt('sort parameters')"
|
||||||
2. Klich at colum header for example `<ID>`
|
2. Klich at colum header for example `<ID>`
|
||||||
* script check if url has already a sort= with `<ID>`
|
* script check if url has already a sort= with `<ID>`
|
||||||
- NO: if sort="" indikates default (with * prefix) set URLsort=<default>
|
- NO: if sort="" indikates default (with * prefix) set URLsort=<default>
|
||||||
|
2
sortt.js
2
sortt.js
@ -17,7 +17,7 @@ if (window.sortt_url.indexOf("sort=") < 0) {
|
|||||||
window.sortt_url=window.sortt_url.substr(0,window.sortt_url.indexOf("&"));
|
window.sortt_url=window.sortt_url.substr(0,window.sortt_url.indexOf("&"));
|
||||||
}
|
}
|
||||||
//creat global function with main routine
|
//creat global function with main routine
|
||||||
window.sortt_f=function(sort_atr){
|
window.sortt=function(sort_atr){
|
||||||
//sortTable [sort attribute]
|
//sortTable [sort attribute]
|
||||||
|
|
||||||
if (sort_atr.length = 0) return;
|
if (sort_atr.length = 0) return;
|
||||||
|
Reference in New Issue
Block a user