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 1212 } ) ;
1313 } ) ;
1414 $ ( "#new-client-submit" ) . click ( function ( ) {
15+ if ( $ ( "#new-client-input" ) . val ( ) . trim ( ) == '' )
16+ return false ;
1517 var baseUrl = OC . generateUrl ( '/apps/timetracker/ajax/add-client/' + $ ( "#new-client-input" ) . val ( ) ) ;
1618 var jqxhr = $ . post ( baseUrl , function ( ) {
1719 getClients ( ) ;
2628 . fail ( function ( ) {
2729 alert ( "error" ) ;
2830 } )
31+ return false ;
2932 } ) ;
3033 dialogClientEditForm = $ ( "#dialog-client-edit-form" ) . dialog ( {
3134 autoOpen : false ,
3538 buttons : {
3639 "Edit client" : { click :function ( ) {
3740 editClient ( dialogClientEditForm ) ;
41+ return false ;
3842 } ,
3943 text : 'Edit client' ,
4044 class : 'primary'
4145 } ,
4246 Cancel : function ( ) {
4347 dialogClientEditForm . dialog ( "close" ) ;
48+ return false ;
4449 }
4550 } ,
4651 close : function ( ) {
104109 form = dialogClientEditForm . find ( "form" )
105110 form . find ( "#name" ) . val ( $ ( e . target ) . data ( "name" ) ) ;
106111 dialogClientEditForm . dialog ( "open" ) ;
107-
112+ return false ;
108113
109114
110115 } )
129134 . always ( function ( ) {
130135
131136 } ) ;
137+ return false ;
132138 } ,
133139 text : 'Confirm' ,
134140 class : 'primary'
135141 } ,
136142 "Cancel" : function ( ) {
137143 $ ( this ) . dialog ( "close" ) ;
144+ return false ;
138145 }
139146 }
140147 } ) ;
141148 $ ( "#dialog-confirm" ) . dialog ( "open" ) ;
149+ return false ;
142150 } )
143151 } ) ;
144152 }
Original file line number Diff line number Diff line change 4747 if ( selectedClient !== null ) {
4848 clientId = selectedClient . id ;
4949 }
50+ if ( $ ( "#new-project-input" ) . val ( ) . trim ( ) == '' )
51+ return false ;
5052 var baseUrl = OC . generateUrl ( '/apps/timetracker/ajax/add-project/' + $ ( "#new-project-input" ) . val ( ) ) ;
5153 var jqxhr = $ . post ( baseUrl , { clientId :clientId } , function ( ) {
5254 getProjects ( ) ;
6163 . fail ( function ( ) {
6264 alert ( "error" ) ;
6365 } ) ;
66+ return false ;
6467 } ) ;
6568 dialogProjectEditForm = $ ( "#dialog-project-edit-form" ) . dialog ( {
6669 autoOpen : false ,
7780 } else {
7881 $ ( "#locked-options" ) . addClass ( 'hidden' ) ;
7982 }
83+
8084 } ) ;
8185 }
8286
335339 rowClick :function ( e , row ) {
336340
337341 if ( ! isAdmin ( ) && row . getData ( ) . locked ) {
338- return ;
342+ return false ;
339343 }
340344 e . preventDefault ( ) ;
341345 dialogProjectEditForm . target = row ;
368372 }
369373 }
370374 dialogProjectEditForm . dialog ( "open" ) ;
371-
375+ return false ;
372376 } ,
373377 ajaxResponse :function ( url , params , response ) {
374378
Original file line number Diff line number Diff line change 189189 } ) ;
190190 $ ( "#download-csv" ) . click ( function ( ) {
191191 table . download ( "csv" , "data.csv" ) ;
192+ return false ;
192193 } ) ;
193194 $ ( "#download-json" ) . click ( function ( ) {
194195 table . download ( "json" , "data.json" ) ;
196+ return false ;
195197 } ) ;
196198 }
197199 } ) ;
Original file line number Diff line number Diff line change 1111 } ) ;
1212 } ) ;
1313 $ ( "#new-tag-submit" ) . click ( function ( ) {
14+ if ( $ ( "#new-tag-input" ) . val ( ) . trim ( ) == '' )
15+ return false ;
1416 var baseUrl = OC . generateUrl ( '/apps/timetracker/ajax/add-tag/' + $ ( "#new-tag-input" ) . val ( ) ) ;
1517 var jqxhr = $ . post ( baseUrl , function ( ) {
1618
2628 . fail ( function ( ) {
2729 alert ( "error" ) ;
2830 } )
31+ return false ;
2932 } ) ;
3033 dialogTagEditForm = $ ( "#dialog-tag-edit-form" ) . dialog ( {
3134 autoOpen : false ,
3538 buttons : {
3639 "Edit tag" : { click : function ( ) {
3740 editTag ( dialogTagEditForm ) ;
41+ return false ;
3842 } ,
3943 text : 'Edit tag' ,
4044 class :'primary'
104108 dialogTagEditForm . dialog ( "open" ) ;
105109
106110
107-
111+ return false ;
108112 } )
109113 $ ( '.tag-delete' ) . click ( function ( e ) {
110114 $ ( "#dialog-confirm" ) . dialog ( {
124128 . fail ( function ( ) {
125129 alert ( "error" ) ;
126130 } )
131+ return false ;
127132 } ,
128133 text : 'Confirm' ,
129134 class :'primary'
134139 }
135140 } ) ;
136141 $ ( "#dialog-confirm" ) . dialog ( "open" ) ;
142+ return false ;
137143 } )
138144 } ) ;
139145 }
Original file line number Diff line number Diff line change 187187 form = dialogWorkItemEditForm . find ( "form" )
188188 form . find ( "#name" ) . val ( $ ( e . target ) . data ( "name" ) ) ;
189189 dialogWorkItemEditForm . dialog ( "open" ) ;
190+ return false ;
190191
191192 } )
192193 $ ( '.wi-play' ) . click ( function ( e ) {
193194 e . preventDefault ( ) ;
194195 $ ( '#work-input' ) . val ( $ ( this ) . data ( 'work-name' ) ) ;
195196 startTimer ( ) ;
197+ return false ;
196198 } )
197199 $ ( '.wi-trash' ) . click ( function ( e ) {
198200 $ ( "#dialog-confirm" ) . dialog ( {
216218 }
217219 } ) ;
218220 $ ( "#dialog-confirm" ) . dialog ( "open" ) ;
221+ return false ;
219222 } ) ;
220223
221224 $ ( ".set-project" ) . each ( function ( ) {
404407 } else {
405408 startTimer ( ) ;
406409 }
410+ return false ;
407411 } ) ;
408412 } ) ;
409413
You can’t perform that action at this time.
0 commit comments