File tree Expand file tree Collapse file tree 4 files changed +13
-11
lines changed Expand file tree Collapse file tree 4 files changed +13
-11
lines changed Original file line number Diff line number Diff line change 50
50
</div>
51
51
</div>
52
52
<button class="ui small teal button" id="delete-selection" data-link="{{.Link}}/delete" data-redirect="{{.Link}}?page={{.Page.Paginater.Current}}">
53
- {{ctx.Locale.Tr "admin.notices.delete_selected"}}
53
+ <span class="text"> {{ctx.Locale.Tr "admin.notices.delete_selected"}}</span>
54
54
</button>
55
55
</th>
56
56
</tr>
Original file line number Diff line number Diff line change @@ -208,7 +208,7 @@ export function initAdminCommon() {
208
208
$ ( '#delete-selection' ) . on ( 'click' , async function ( e ) {
209
209
e . preventDefault ( ) ;
210
210
const $this = $ ( this ) ;
211
- $this . addClass ( 'loading disabled' ) ;
211
+ $this . addClass ( 'is- loading disabled' ) ;
212
212
const data = new FormData ( ) ;
213
213
$checkboxes . each ( function ( ) {
214
214
if ( $ ( this ) . checkbox ( 'is checked' ) ) {
Original file line number Diff line number Diff line change @@ -3,31 +3,33 @@ import {hideElem, showElem} from '../utils/dom.js';
3
3
import { POST } from '../modules/fetch.js' ;
4
4
5
5
async function getArchive ( $target , url , first ) {
6
+ const dropdownBtn = $target [ 0 ] . closest ( '.ui.dropdown.button' ) ;
7
+
6
8
try {
9
+ dropdownBtn . classList . add ( 'is-loading' ) ;
7
10
const response = await POST ( url ) ;
8
11
if ( response . status === 200 ) {
9
12
const data = await response . json ( ) ;
10
13
if ( ! data ) {
11
14
// XXX Shouldn't happen?
12
- $target . closest ( '.dropdown' ) . children ( 'i' ) . removeClass ( ' loading') ;
15
+ dropdownBtn . classList . remove ( 'is- loading') ;
13
16
return ;
14
17
}
15
18
16
19
if ( ! data . complete ) {
17
- $target . closest ( '.dropdown' ) . children ( 'i' ) . addClass ( 'loading' ) ;
18
20
// Wait for only three quarters of a second initially, in case it's
19
21
// quickly archived.
20
22
setTimeout ( ( ) => {
21
23
getArchive ( $target , url , false ) ;
22
24
} , first ? 750 : 2000 ) ;
23
25
} else {
24
26
// We don't need to continue checking.
25
- $target . closest ( '.dropdown' ) . children ( 'i' ) . removeClass ( ' loading') ;
27
+ dropdownBtn . classList . remove ( 'is- loading') ;
26
28
window . location . href = url ;
27
29
}
28
30
}
29
31
} catch {
30
- $target . closest ( '.dropdown' ) . children ( 'i' ) . removeClass ( ' loading') ;
32
+ dropdownBtn . classList . remove ( 'is- loading') ;
31
33
}
32
34
}
33
35
Original file line number Diff line number Diff line change @@ -43,14 +43,14 @@ export function initRepoIssueTimeTracking() {
43
43
44
44
async function updateDeadline ( deadlineString ) {
45
45
hideElem ( $ ( '#deadline-err-invalid-date' ) ) ;
46
- $ ( '#deadline-loader' ) . addClass ( 'loading' ) ;
46
+ $ ( '#deadline-loader' ) . addClass ( 'is- loading' ) ;
47
47
48
48
let realDeadline = null ;
49
49
if ( deadlineString !== '' ) {
50
50
const newDate = Date . parse ( deadlineString ) ;
51
51
52
52
if ( Number . isNaN ( newDate ) ) {
53
- $ ( '#deadline-loader' ) . removeClass ( 'loading' ) ;
53
+ $ ( '#deadline-loader' ) . removeClass ( 'is- loading' ) ;
54
54
showElem ( $ ( '#deadline-err-invalid-date' ) ) ;
55
55
return false ;
56
56
}
@@ -69,7 +69,7 @@ async function updateDeadline(deadlineString) {
69
69
}
70
70
} catch ( error ) {
71
71
console . error ( error ) ;
72
- $ ( '#deadline-loader' ) . removeClass ( 'loading' ) ;
72
+ $ ( '#deadline-loader' ) . removeClass ( 'is- loading' ) ;
73
73
showElem ( $ ( '#deadline-err-invalid-date' ) ) ;
74
74
}
75
75
}
@@ -231,14 +231,14 @@ export function initRepoPullRequestUpdate() {
231
231
e . preventDefault ( ) ;
232
232
const $this = $ ( this ) ;
233
233
const redirect = $this . data ( 'redirect' ) ;
234
- $this . addClass ( 'loading' ) ;
234
+ $this . addClass ( 'is- loading' ) ;
235
235
let response ;
236
236
try {
237
237
response = await POST ( $this . data ( 'do' ) ) ;
238
238
} catch ( error ) {
239
239
console . error ( error ) ;
240
240
} finally {
241
- $this . removeClass ( 'loading' ) ;
241
+ $this . removeClass ( 'is- loading' ) ;
242
242
}
243
243
let data ;
244
244
try {
You can’t perform that action at this time.
0 commit comments