summaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorGuillermo BonvehĂ­ <gbonvehi@gmail.com>2017-06-28 05:55:28 -0300
committerLunny Xiao <xiaolunwen@gmail.com>2017-06-28 16:55:28 +0800
commit858197b4538cc0fe057f1bea4e62e6bdb8e8b331 (patch)
tree66fe15b133583cea6f45b2503863534b7deb2770 /public
parent6b13dafe61df99c6831f8d69af764727c3cc6b52 (diff)
downloadgitea-858197b4538cc0fe057f1bea4e62e6bdb8e8b331.tar.gz
gitea-858197b4538cc0fe057f1bea4e62e6bdb8e8b331.zip
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.
Diffstat (limited to 'public')
-rw-r--r--public/js/index.js12
1 files changed, 4 insertions, 8 deletions
diff --git a/public/js/index.js b/public/js/index.js
index 80d9486fd1..25915bc2ab 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -189,12 +189,6 @@ function initCommentForm() {
var $list = $('.ui' + select_id + '.list');
var hasUpdateAction = $menu.data('action') == 'update';
- $(select_id).dropdown('setting', 'onHide', function(){
- if (hasUpdateAction) {
- location.reload();
- }
- });
-
$menu.find('.item:not(.no-select)').click(function () {
$(this).parent().find('.item').each(function () {
$(this).removeClass('selected active')
@@ -206,7 +200,8 @@ function initCommentForm() {
$menu.data('update-url'),
"",
$menu.data('issue-id'),
- $(this).data('id')
+ $(this).data('id'),
+ function() { location.reload(); }
);
}
switch (input_id) {
@@ -232,7 +227,8 @@ function initCommentForm() {
$menu.data('update-url'),
"",
$menu.data('issue-id'),
- $(this).data('id')
+ $(this).data('id'),
+ function() { location.reload(); }
);
}