Skip to content

Commit 2804523

Browse files
committed
添加 注释
1 parent 62ca690 commit 2804523

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Lanzou-Enhanced.user.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,9 +795,12 @@
795795

796796
function clickSortButton(by, button) {
797797
if (currentStatus.by === by) {
798+
// 当前选项,点击时,反转排序
798799
currentStatus.order = button.textContent === '⬆' ? 'desc' : 'asc';
799800
} else {
801+
// 非当前选项,点击时,以图标所示的顺序排序
800802
currentStatus.order = button.textContent === '⇧' ? 'asc' : 'desc';
803+
// 修改非当前选项按钮的图标
801804
for (const key in allButtons) {
802805
if (key === by) continue;
803806
if (Object.hasOwnProperty.call(allButtons, key)) {
@@ -831,7 +834,7 @@
831834
const fileObserver = new MutationObserver(fileListCallback);
832835
fileObserver.observe(fileList, { childList: true, attributes: false });
833836

834-
// sort files
837+
// sort folders
835838
const folderList = frameDoc.querySelector('#sub_folder_list');;
836839
const folderObserver = new MutationObserver(folderListCallback);
837840
folderObserver.observe(folderList, { childList: true, attributes: false });

0 commit comments

Comments
 (0)