瀏覽代碼

Add a negative filter

Takayuki Nakata 3 年之前
父節點
當前提交
8d05684e86
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      templates/triage/pulls.html

+ 6 - 1
templates/triage/pulls.html

@@ -57,18 +57,23 @@
                             var td;
                             switch (flt[0]) {
                                 case 'label':
+                                case '-label':
                                     td = tr[i].getElementsByTagName("td")[6];
                                     break;
                                 case 'assignee':
+                                case '-assignee':
                                     td = tr[i].getElementsByTagName("td")[5];
                                     break;
                                 case 'author':
+                                case '-author':
                                     td = tr[i].getElementsByTagName("td")[4];
                                     break;
                             }
                             if (td) {
                                 txtValue = td.textContent || td.innerText;
-                                if (txtValue.indexOf(flt[1]) > -1) {
+                                console.log(flt[0].charAt(0));
+                                if ((flt[0].charAt(0) != '-' && txtValue.indexOf(flt[1]) > -1)
+                                    || (flt[0].charAt(0) == '-' && txtValue.indexOf(flt[1]) <= -1)) {
                                     tr[i].style.display = "";
                                 } else {
                                     tr[i].style.display = "none";