Skip to content

Commit 4be09a3

Browse files
committed
js fixes for firefox
1 parent bcd21b5 commit 4be09a3

File tree

5 files changed

+28
-4
lines changed

5 files changed

+28
-4
lines changed

js/clients.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
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();
@@ -26,6 +28,7 @@
2628
.fail(function() {
2729
alert( "error" );
2830
})
31+
return false;
2932
});
3033
dialogClientEditForm = $( "#dialog-client-edit-form" ).dialog({
3134
autoOpen: false,
@@ -35,12 +38,14 @@
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() {
@@ -104,7 +109,7 @@
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
})
@@ -129,16 +134,19 @@
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
}

js/projects.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
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();
@@ -61,6 +63,7 @@
6163
.fail(function() {
6264
alert( "error" );
6365
});
66+
return false;
6467
});
6568
dialogProjectEditForm = $( "#dialog-project-edit-form" ).dialog({
6669
autoOpen: false,
@@ -77,6 +80,7 @@
7780
} else {
7881
$("#locked-options").addClass('hidden');
7982
}
83+
8084
});
8185
}
8286

@@ -335,7 +339,7 @@
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;
@@ -368,7 +372,7 @@
368372
}
369373
}
370374
dialogProjectEditForm.dialog("open");
371-
375+
return false;
372376
},
373377
ajaxResponse:function(url, params, response){
374378

js/reports.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,11 @@
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
});

js/tags.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
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

@@ -26,6 +28,7 @@
2628
.fail(function() {
2729
alert( "error" );
2830
})
31+
return false;
2932
});
3033
dialogTagEditForm = $( "#dialog-tag-edit-form" ).dialog({
3134
autoOpen: false,
@@ -35,6 +38,7 @@
3538
buttons: {
3639
"Edit tag": {click: function(){
3740
editTag(dialogTagEditForm);
41+
return false;
3842
},
3943
text: 'Edit tag',
4044
class:'primary'
@@ -104,7 +108,7 @@
104108
dialogTagEditForm.dialog("open");
105109

106110

107-
111+
return false;
108112
})
109113
$('.tag-delete').click(function(e) {
110114
$("#dialog-confirm").dialog({
@@ -124,6 +128,7 @@
124128
.fail(function() {
125129
alert( "error" );
126130
})
131+
return false;
127132
},
128133
text: 'Confirm',
129134
class:'primary'
@@ -134,6 +139,7 @@
134139
}
135140
});
136141
$("#dialog-confirm").dialog("open");
142+
return false;
137143
})
138144
});
139145
}

js/timer.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,14 @@
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({
@@ -216,6 +218,7 @@
216218
}
217219
});
218220
$("#dialog-confirm").dialog("open");
221+
return false;
219222
});
220223

221224
$(".set-project").each(function(){
@@ -404,6 +407,7 @@
404407
} else {
405408
startTimer();
406409
}
410+
return false;
407411
});
408412
} );
409413

0 commit comments

Comments
 (0)