Skip to content

Commit

Permalink
Merge branch 'master' into qa
Browse files Browse the repository at this point in the history
  • Loading branch information
SaptakS authored Dec 31, 2018
2 parents a7033b5 + 1cee59a commit 0b556b2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
16 changes: 12 additions & 4 deletions app/assets/v2/js/pages/bounty_details.js
Original file line number Diff line number Diff line change
Expand Up @@ -621,13 +621,21 @@ var show_interest_modal = function() {
return false;
}

$(self).attr('href', '/uninterested');
$(self).find('span').text(gettext('Stop Work'));
$(self).parent().attr('title', '<div class="tooltip-info tooltip-sm">' + gettext('Notify the funder that you will not be working on this project') + '</div>');

add_interest(document.result['pk'], {
issue_message: msg
}).then(success => {
if (success) {
$(self).attr('href', '/uninterested');
$(self).find('span').text(gettext('Stop Work'));
$(self).parent().attr('title', '<div class="tooltip-info tooltip-sm">' + gettext('Notify the funder that you will not be working on this project') + '</div>');
$.modal.close();
}
}).catch((error) => {
if (error.responseJSON.error === 'You may only work on max of 3 issues at once.')
return;
throw error;
});
$.modal.close();
});
});
});
Expand Down
6 changes: 3 additions & 3 deletions app/assets/v2/js/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ var add_interest = function(bounty_pk, data) {
if (document.interested) {
return;
}
mutate_interest(bounty_pk, 'new', data);
return mutate_interest(bounty_pk, 'new', data);
};

/** Remove the current profile from the interested profiles list. */
Expand All @@ -284,7 +284,7 @@ var mutate_interest = function(bounty_pk, direction, data) {
var request_url = '/actions/bounty/' + bounty_pk + '/interest/' + direction + '/';

showBusyOverlay();
$.post(request_url, data).then(function(result) {
return $.post(request_url, data).then(function(result) {
hideBusyOverlay();

result = sanitizeAPIResults(result);
Expand All @@ -293,6 +293,7 @@ var mutate_interest = function(bounty_pk, direction, data) {
if (direction === 'new') {
_alert({ message: result.msg }, 'success');
$('#interest a').attr('id', 'btn-white');
return true;
} else if (direction === 'remove') {
_alert({ message: result.msg }, 'success');
$('#interest a').attr('id', '');
Expand All @@ -312,7 +313,6 @@ var mutate_interest = function(bounty_pk, direction, data) {
}

_alert({ message: alertMsg }, 'error');

});
};

Expand Down

0 comments on commit 0b556b2

Please sign in to comment.