-
- Notifications
You must be signed in to change notification settings - Fork 6.2k
Disable Create column button while the column name is empty #25192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
bf1cc3e 50d6189 38e4e09 b0ccb3d 8cd07d1 75d457f 8649ce7 d9b01e6 462471f 98dca82 ff3b9b4 b0d9208 File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| | @@ -9,6 +9,20 @@ function updateIssueCount(cards) { | |
| parent.getElementsByClassName('board-card-cnt')[0].textContent = cnt; | ||
| } | ||
| | ||
| function createNewBoard(boardTitle, projectColorInput) { | ||
| $.ajax({ | ||
| url: $(this).data('url'), | ||
puni9869 marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| data: JSON.stringify({title: boardTitle.val(), color: projectColorInput.val()}), | ||
| headers: { | ||
| 'X-Csrf-Token': csrfToken, | ||
| }, | ||
| contentType: 'application/json', | ||
| method: 'POST', | ||
| }).done(() => { | ||
| boardTitle.closest('form').removeClass('dirty'); | ||
| window.location.reload(); | ||
| }); | ||
| } | ||
| function moveIssue({item, from, to, oldIndex}) { | ||
| const columnCards = to.getElementsByClassName('board-card'); | ||
| updateIssueCount(from); | ||
| | @@ -168,24 +182,27 @@ export function initRepoProject() { | |
| }); | ||
| }); | ||
| | ||
| $('#new_board_submit').on('click', function (e) { | ||
| $('#new_board_submit').on('click', (e) => { | ||
| e.preventDefault(); | ||
| | ||
| const boardTitle = $('#new_board'); | ||
| const projectColorInput = $('#new_board_color_picker'); | ||
| if (boardTitle.val().length < 1) { | ||
| return false; | ||
puni9869 marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| } | ||
| createNewBoard(boardTitle, projectColorInput); | ||
| }); | ||
| | ||
| $.ajax({ | ||
| url: $(this).data('url'), | ||
| data: JSON.stringify({title: boardTitle.val(), color: projectColorInput.val()}), | ||
| headers: { | ||
| 'X-Csrf-Token': csrfToken, | ||
| }, | ||
| contentType: 'application/json', | ||
| method: 'POST', | ||
| }).done(() => { | ||
| boardTitle.closest('form').removeClass('dirty'); | ||
| window.location.reload(); | ||
| }); | ||
| $('.new-board').on('keyup', (e) => { | ||
| ||
| const boardTitle = $('#new_board'); | ||
| const projectColorInput = $('#new_board_color_picker'); | ||
| if (boardTitle.val().length < 1) { | ||
| $('#new_board_submit').addClass('disabled'); | ||
| return false; | ||
puni9869 marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| } | ||
| $(`#new_board_submit`).removeClass('disabled'); | ||
| if (e.key === 'Enter' || e.keyCode === 13) { | ||
puni9869 marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| createNewBoard(boardTitle, projectColorInput); | ||
| } | ||
| }); | ||
| } | ||
| | ||
| | ||
Uh oh!
There was an error while loading. Please reload this page.