Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Cesium
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Benjamin Bertrand
Cesium
Commits
4df0c1fb
Commit
4df0c1fb
authored
6 years ago
by
Benoit Lavenier
Browse files
Options
Downloads
Patches
Plain Diff
[fix] Comment: submit when press Ctrl+Enter
parent
df27b4e1
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
www/plugins/es/js/controllers/common-controllers.js
+8
-0
8 additions, 0 deletions
www/plugins/es/js/controllers/common-controllers.js
www/plugins/es/templates/common/view_comments.html
+8
-7
8 additions, 7 deletions
www/plugins/es/templates/common/view_comments.html
with
16 additions
and
7 deletions
www/plugins/es/js/controllers/common-controllers.js
+
8
−
0
View file @
4df0c1fb
...
@@ -214,6 +214,14 @@ function ESCommentsController($scope, $filter, $state, $focus, UIUtils) {
...
@@ -214,6 +214,14 @@ function ESCommentsController($scope, $filter, $state, $focus, UIUtils) {
});
});
};
};
$scope
.
onKeypress
=
function
(
event
)
{
// If Ctrl + Enter: submit
if
(
event
&&
event
.
charCode
==
10
&&
event
.
ctrlKey
)
{
$scope
.
save
();
event
.
preventDefault
();
}
};
$scope
.
save
=
function
()
{
$scope
.
save
=
function
()
{
if
(
!
$scope
.
formData
.
message
||
!
$scope
.
formData
.
message
.
length
)
return
;
if
(
!
$scope
.
formData
.
message
||
!
$scope
.
formData
.
message
.
length
)
return
;
...
...
This diff is collapsed.
Click to expand it.
www/plugins/es/templates/common/view_comments.html
+
8
−
7
View file @
4df0c1fb
<
div
class=
"comments"
ng-controller=
"ESCommentsCtrl"
>
<
form
class=
"comments"
ng-controller=
"ESCommentsCtrl"
ng-submit=
"save()"
>
<div
class=
"item item-divider"
>
<div
class=
"item item-divider"
>
<i
class=
"icon ion-chatboxes"
></i>
<i
class=
"icon ion-chatboxes"
></i>
...
@@ -48,10 +48,11 @@
...
@@ -48,10 +48,11 @@
id=
"comment-form-textarea"
id=
"comment-form-textarea"
rows=
"3"
rows=
"3"
placeholder=
"{{formData.replyTo ? 'COMMENTS.COMMENT_HELP_REPLY_TO' : 'COMMENTS.COMMENT_HELP'|translate}}"
placeholder=
"{{formData.replyTo ? 'COMMENTS.COMMENT_HELP_REPLY_TO' : 'COMMENTS.COMMENT_HELP'|translate}}"
ng-model=
"formData.message"
>
ng-model=
"formData.message"
ng-keypress=
"onKeypress($event)"
>
</textarea>
</textarea>
<div
class=
"card-footer text-right"
>
<div
class=
"card-footer text-right"
>
<button
class=
"button button-small button-small-padding"
<button
type=
"button"
class=
"button button-small button-small-padding"
ng-class=
"{'button-positive': formData.message.length}"
ng-class=
"{'button-positive': formData.message.length}"
ng-if=
"!formData.id"
ng-if=
"!formData.id"
ng-click=
"save()"
translate
>
ng-click=
"save()"
translate
>
...
@@ -59,11 +60,11 @@
...
@@ -59,11 +60,11 @@
</button>
</button>
<!-- Edit buttons -->
<!-- Edit buttons -->
<ng-if
ng-if=
"formData.id"
>
<ng-if
ng-if=
"formData.id"
>
<button
class=
"button button-small button-small-padding"
<button
type=
"button"
class=
"button button-small button-small-padding"
ng-click=
"cancel()"
translate
>
ng-click=
"cancel()"
translate
>
COMMON.BTN_CANCEL
COMMON.BTN_CANCEL
</button>
</button>
<button
class=
"button button-small button-small-padding button-positive"
<button
type=
"button"
class=
"button button-small button-small-padding button-positive"
ng-click=
"save()"
translate
>
ng-click=
"save()"
translate
>
COMMON.BTN_SAVE
COMMON.BTN_SAVE
</button>
</button>
...
@@ -105,11 +106,11 @@
...
@@ -105,11 +106,11 @@
placeholder=
"{{'COMMENTS.COMMENT_HELP'|translate}}"
placeholder=
"{{'COMMENTS.COMMENT_HELP'|translate}}"
on-return=
"save();"
on-return=
"save();"
ng-model=
"formData.message"
/>
ng-model=
"formData.message"
/>
<button
class=
"button button-small button-small-padding button-icon button-dark button-icon gray"
ng-click=
"save()"
>
<button
type=
"submit"
class=
"button button-small button-small-padding button-icon button-dark button-icon gray"
>
<i
class=
"icon ion-android-send"
></i>
<i
class=
"icon ion-android-send"
></i>
</button>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</
div
>
</
form
>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment