Skip to content

Instantly share code, notes, and snippets.

@bkcsoft
Created June 26, 2017 23:44
Show Gist options
  • Save bkcsoft/4b655d32f969ff905926bfedfb5f6f97 to your computer and use it in GitHub Desktop.
Save bkcsoft/4b655d32f969ff905926bfedfb5f6f97 to your computer and use it in GitHub Desktop.
diff --git a/public/js/index.js b/public/js/index.js
index 80d9486f..7516b7b1 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')
@@ -204,10 +198,13 @@ function initCommentForm() {
if (hasUpdateAction) {
updateIssuesMeta(
$menu.data('update-url'),
- "",
+ $menu.data('action'),
$menu.data('issue-id'),
- $(this).data('id')
- );
+ $(this).data('id'),
+ function() {
+ window.reload();
+ }
+ );
}
switch (input_id) {
case '#milestone_id':
@@ -221,24 +218,30 @@ function initCommentForm() {
}
$('.ui' + select_id + '.list .no-select').addClass('hide');
$(input_id).val($(this).data('id'));
+ return false;
});
$menu.find('.no-select.item').click(function () {
$(this).parent().find('.item:not(.no-select)').each(function () {
$(this).removeClass('selected active')
});
- if (hasUpdateAction) {
+ $list.find('.selected').html('');
+ $list.find('.no-select').removeClass('hide');
+ $(input_id).val('');
+
+ if (hasUpdateAction) {
updateIssuesMeta(
$menu.data('update-url'),
- "",
+ $menu.data('action'),
$menu.data('issue-id'),
- $(this).data('id')
+ $(this).data('id'),
+ function() {
+ window.reload();
+ }
);
}
- $list.find('.selected').html('');
- $list.find('.no-select').removeClass('hide');
- $(input_id).val('');
+ return false;
});
}
@bkcsoft
Copy link
Author

bkcsoft commented Jun 26, 2017

window.reload() => window.location.reload() 🙄 (I'm not a frontend person 😂 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment