Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
44c01ecc
Commit
44c01ecc
authored
Oct 13, 2017
by
Simon Knox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
submit form on enter key. disable button when field empty
parent
834cc1b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
app/assets/javascripts/boards/components/board_form.vue
app/assets/javascripts/boards/components/board_form.vue
+11
-4
No files found.
app/assets/javascripts/boards/components/board_form.vue
View file @
44c01ecc
<
script
>
/* global BoardService */
/* global Flash */
import
Flash
from
'
~/flash
'
;
import
PopupDialog
from
'
~/vue_shared/components/popup_dialog.vue
'
;
import
BoardMilestoneSelect
from
'
./milestone_select.vue
'
;
import
BoardWeightSelect
from
'
./weight_select.vue
'
;
...
...
@@ -65,7 +65,7 @@ export default {
currentPage
:
Store
.
state
.
currentPage
,
milestones
:
[],
milestoneDropdownOpen
:
false
,
submitDisabled
:
false
,
isLoading
:
false
,
};
},
components
:
{
...
...
@@ -127,18 +127,22 @@ export default {
weightsArray
()
{
return
JSON
.
parse
(
this
.
weights
);
},
submitDisabled
()
{
return
this
.
isLoading
||
this
.
board
.
name
.
length
===
0
;
},
},
methods
:
{
submit
()
{
if
(
this
.
board
.
name
.
length
===
0
)
return
;
this
.
isLoading
=
true
;
if
(
this
.
isDeleteForm
)
{
this
.
submitDisabled
=
true
;
gl
.
boardService
.
deleteBoard
(
this
.
currentBoard
)
.
then
(()
=>
{
gl
.
utils
.
visitUrl
(
Store
.
rootPath
);
})
.
catch
(()
=>
{
Flash
(
'
Failed to delete board. Please try again.
'
);
this
.
submitDisabled
=
false
;
this
.
isLoading
=
false
;
});
}
else
{
gl
.
boardService
.
createBoard
(
this
.
board
)
...
...
@@ -148,6 +152,7 @@ export default {
})
.
catch
(()
=>
{
Flash
(
'
Unable to save your changes. Please try again.
'
);
this
.
isLoading
=
false
;
});
}
},
...
...
@@ -191,6 +196,7 @@ export default {
<form
v-else
class=
"js-board-config-modal"
@
submit
.
prevent
>
<div
v-if=
"!readonly"
...
...
@@ -208,6 +214,7 @@ export default {
type=
"text"
id=
"board-new-name"
v-model=
"board.name"
@
keyup.enter=
"submit"
placeholder=
"Enter board name"
>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment