File tree Expand file tree Collapse file tree 5 files changed +28
-4
lines changed Expand file tree Collapse file tree 5 files changed +28
-4
lines changed Original file line number Diff line number Diff line change 12
12
} ) ;
13
13
} ) ;
14
14
$ ( "#new-client-submit" ) . click ( function ( ) {
15
+ if ( $ ( "#new-client-input" ) . val ( ) . trim ( ) == '' )
16
+ return false ;
15
17
var baseUrl = OC . generateUrl ( '/apps/timetracker/ajax/add-client/' + $ ( "#new-client-input" ) . val ( ) ) ;
16
18
var jqxhr = $ . post ( baseUrl , function ( ) {
17
19
getClients ( ) ;
26
28
. fail ( function ( ) {
27
29
alert ( "error" ) ;
28
30
} )
31
+ return false ;
29
32
} ) ;
30
33
dialogClientEditForm = $ ( "#dialog-client-edit-form" ) . dialog ( {
31
34
autoOpen : false ,
35
38
buttons : {
36
39
"Edit client" : { click :function ( ) {
37
40
editClient ( dialogClientEditForm ) ;
41
+ return false ;
38
42
} ,
39
43
text : 'Edit client' ,
40
44
class : 'primary'
41
45
} ,
42
46
Cancel : function ( ) {
43
47
dialogClientEditForm . dialog ( "close" ) ;
48
+ return false ;
44
49
}
45
50
} ,
46
51
close : function ( ) {
104
109
form = dialogClientEditForm . find ( "form" )
105
110
form . find ( "#name" ) . val ( $ ( e . target ) . data ( "name" ) ) ;
106
111
dialogClientEditForm . dialog ( "open" ) ;
107
-
112
+ return false ;
108
113
109
114
110
115
} )
129
134
. always ( function ( ) {
130
135
131
136
} ) ;
137
+ return false ;
132
138
} ,
133
139
text : 'Confirm' ,
134
140
class : 'primary'
135
141
} ,
136
142
"Cancel" : function ( ) {
137
143
$ ( this ) . dialog ( "close" ) ;
144
+ return false ;
138
145
}
139
146
}
140
147
} ) ;
141
148
$ ( "#dialog-confirm" ) . dialog ( "open" ) ;
149
+ return false ;
142
150
} )
143
151
} ) ;
144
152
}
Original file line number Diff line number Diff line change 47
47
if ( selectedClient !== null ) {
48
48
clientId = selectedClient . id ;
49
49
}
50
+ if ( $ ( "#new-project-input" ) . val ( ) . trim ( ) == '' )
51
+ return false ;
50
52
var baseUrl = OC . generateUrl ( '/apps/timetracker/ajax/add-project/' + $ ( "#new-project-input" ) . val ( ) ) ;
51
53
var jqxhr = $ . post ( baseUrl , { clientId :clientId } , function ( ) {
52
54
getProjects ( ) ;
61
63
. fail ( function ( ) {
62
64
alert ( "error" ) ;
63
65
} ) ;
66
+ return false ;
64
67
} ) ;
65
68
dialogProjectEditForm = $ ( "#dialog-project-edit-form" ) . dialog ( {
66
69
autoOpen : false ,
77
80
} else {
78
81
$ ( "#locked-options" ) . addClass ( 'hidden' ) ;
79
82
}
83
+
80
84
} ) ;
81
85
}
82
86
335
339
rowClick :function ( e , row ) {
336
340
337
341
if ( ! isAdmin ( ) && row . getData ( ) . locked ) {
338
- return ;
342
+ return false ;
339
343
}
340
344
e . preventDefault ( ) ;
341
345
dialogProjectEditForm . target = row ;
368
372
}
369
373
}
370
374
dialogProjectEditForm . dialog ( "open" ) ;
371
-
375
+ return false ;
372
376
} ,
373
377
ajaxResponse :function ( url , params , response ) {
374
378
Original file line number Diff line number Diff line change 189
189
} ) ;
190
190
$ ( "#download-csv" ) . click ( function ( ) {
191
191
table . download ( "csv" , "data.csv" ) ;
192
+ return false ;
192
193
} ) ;
193
194
$ ( "#download-json" ) . click ( function ( ) {
194
195
table . download ( "json" , "data.json" ) ;
196
+ return false ;
195
197
} ) ;
196
198
}
197
199
} ) ;
Original file line number Diff line number Diff line change 11
11
} ) ;
12
12
} ) ;
13
13
$ ( "#new-tag-submit" ) . click ( function ( ) {
14
+ if ( $ ( "#new-tag-input" ) . val ( ) . trim ( ) == '' )
15
+ return false ;
14
16
var baseUrl = OC . generateUrl ( '/apps/timetracker/ajax/add-tag/' + $ ( "#new-tag-input" ) . val ( ) ) ;
15
17
var jqxhr = $ . post ( baseUrl , function ( ) {
16
18
26
28
. fail ( function ( ) {
27
29
alert ( "error" ) ;
28
30
} )
31
+ return false ;
29
32
} ) ;
30
33
dialogTagEditForm = $ ( "#dialog-tag-edit-form" ) . dialog ( {
31
34
autoOpen : false ,
35
38
buttons : {
36
39
"Edit tag" : { click : function ( ) {
37
40
editTag ( dialogTagEditForm ) ;
41
+ return false ;
38
42
} ,
39
43
text : 'Edit tag' ,
40
44
class :'primary'
104
108
dialogTagEditForm . dialog ( "open" ) ;
105
109
106
110
107
-
111
+ return false ;
108
112
} )
109
113
$ ( '.tag-delete' ) . click ( function ( e ) {
110
114
$ ( "#dialog-confirm" ) . dialog ( {
124
128
. fail ( function ( ) {
125
129
alert ( "error" ) ;
126
130
} )
131
+ return false ;
127
132
} ,
128
133
text : 'Confirm' ,
129
134
class :'primary'
134
139
}
135
140
} ) ;
136
141
$ ( "#dialog-confirm" ) . dialog ( "open" ) ;
142
+ return false ;
137
143
} )
138
144
} ) ;
139
145
}
Original file line number Diff line number Diff line change 187
187
form = dialogWorkItemEditForm . find ( "form" )
188
188
form . find ( "#name" ) . val ( $ ( e . target ) . data ( "name" ) ) ;
189
189
dialogWorkItemEditForm . dialog ( "open" ) ;
190
+ return false ;
190
191
191
192
} )
192
193
$ ( '.wi-play' ) . click ( function ( e ) {
193
194
e . preventDefault ( ) ;
194
195
$ ( '#work-input' ) . val ( $ ( this ) . data ( 'work-name' ) ) ;
195
196
startTimer ( ) ;
197
+ return false ;
196
198
} )
197
199
$ ( '.wi-trash' ) . click ( function ( e ) {
198
200
$ ( "#dialog-confirm" ) . dialog ( {
216
218
}
217
219
} ) ;
218
220
$ ( "#dialog-confirm" ) . dialog ( "open" ) ;
221
+ return false ;
219
222
} ) ;
220
223
221
224
$ ( ".set-project" ) . each ( function ( ) {
404
407
} else {
405
408
startTimer ( ) ;
406
409
}
410
+ return false ;
407
411
} ) ;
408
412
} ) ;
409
413
You can’t perform that action at this time.
0 commit comments