Skip to content

Commit 858197b

Browse files
knixeurlunny
authored andcommitted
Fix #1271: Call location.reload after XHR finishes (#2071)
location.reload was being called when the related dropdown was hidden, even if a request initiated before to update this value hadn't finished. This caused troubles on Firefox.
1 parent 6b13daf commit 858197b

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

public/js/index.js

+4-8
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,6 @@ function initCommentForm() {
189189
var $list = $('.ui' + select_id + '.list');
190190
var hasUpdateAction = $menu.data('action') == 'update';
191191

192-
$(select_id).dropdown('setting', 'onHide', function(){
193-
if (hasUpdateAction) {
194-
location.reload();
195-
}
196-
});
197-
198192
$menu.find('.item:not(.no-select)').click(function () {
199193
$(this).parent().find('.item').each(function () {
200194
$(this).removeClass('selected active')
@@ -206,7 +200,8 @@ function initCommentForm() {
206200
$menu.data('update-url'),
207201
"",
208202
$menu.data('issue-id'),
209-
$(this).data('id')
203+
$(this).data('id'),
204+
function() { location.reload(); }
210205
);
211206
}
212207
switch (input_id) {
@@ -232,7 +227,8 @@ function initCommentForm() {
232227
$menu.data('update-url'),
233228
"",
234229
$menu.data('issue-id'),
235-
$(this).data('id')
230+
$(this).data('id'),
231+
function() { location.reload(); }
236232
);
237233
}
238234

0 commit comments

Comments
 (0)