Skip to content
Snippets Groups Projects
Commit 263edd4e authored by Chris Lawton's avatar Chris Lawton Committed by Todd Dembrey
Browse files

add status and reviewer example form handlers

parent 07d9c12e
No related branches found
No related tags found
No related merge requests found
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
{# Left #} {# Left #}
<div class="actions-bar__inner actions-bar__inner--left"> <div class="actions-bar__inner actions-bar__inner--left">
<p class="actions-bar__total"><span class="js-total-actions">0</span> Selected</p> <p class="actions-bar__total"><span class="js-total-actions">0</span> Selected</p>
<form> <form action="" class="js-batch-update-status">
<button class="button button--action button--change-status" type="submit">Change status</button> <button class="button button--action button--change-status" type="submit">Change status</button>
</form> </form>
<form> <form action="" class="js-batch-update-reviewers">
<button class="button button--action button--reviewers" type="submit">Reviewers</button> <button class="button button--action button--reviewers" type="submit">Reviewers</button>
</form> </form>
</div> </div>
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
const $body = $('body'); const $body = $('body');
const $checkbox = $('.js-batch-select'); const $checkbox = $('.js-batch-select');
const $allCheckboxInput = $('.js-batch-select-all'); const $allCheckboxInput = $('.js-batch-select-all');
const $changeStatusForm = $('.js-batch-update-status');
const $changeReviewersForm = $('.js-batch-update-reviewers');
const activeClass = 'batch-actions-enabled'; const activeClass = 'batch-actions-enabled';
$allCheckboxInput.change(function () { $allCheckboxInput.change(function () {
...@@ -53,6 +55,24 @@ ...@@ -53,6 +55,24 @@
$allCheckboxInput.prop('checked', false); $allCheckboxInput.prop('checked', false);
} }
// change status form handler
$changeStatusForm.submit(function (e) {
e.preventDefault();
$checkbox.each(function () {
if ($(this).is(':checked')) {
console.log($(this).parents('tr').data('record-id')); // tr data-record-id
console.log($(this).parents('tr').find('.js-title').data('tooltip')); // project title
}
});
});
// reviewers form handler
$changeReviewersForm.submit(function (e) {
e.preventDefault();
console.log('reviewers form submitted');
});
})(jQuery); })(jQuery);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment