Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BudgetMaster
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
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Robert Goldmann
BudgetMaster
Commits
a25b95f4
Commit
a25b95f4
authored
4 years ago
by
Robert Goldmann
Browse files
Options
Downloads
Patches
Plain Diff
#533 - confirm selection and redirect to new transaction form template page
parent
d27fcca6
No related branches found
No related tags found
No related merge requests found
Pipeline
#4067
failed
4 years ago
Stage: external
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/resources/static/js/templates.js
+26
-0
26 additions, 0 deletions
src/main/resources/static/js/templates.js
src/main/resources/templates/templates/templateFunctions.ftl
+1
-1
1 addition, 1 deletion
src/main/resources/templates/templates/templateFunctions.ftl
with
27 additions
and
1 deletion
src/main/resources/static/js/templates.js
+
26
−
0
View file @
a25b95f4
...
@@ -120,6 +120,11 @@ function enableHotKeys()
...
@@ -120,6 +120,11 @@ function enableHotKeys()
{
{
handleKeyUpOrDown
(
false
);
handleKeyUpOrDown
(
false
);
});
});
Mousetrap
.
bind
(
'
enter
'
,
function
()
{
confirmTemplateSelection
(
false
);
});
}
}
function
handleKeyUpOrDown
(
isUp
)
function
handleKeyUpOrDown
(
isUp
)
...
@@ -215,3 +220,24 @@ function selectNextItemOnUp(templateItems, previousIndex)
...
@@ -215,3 +220,24 @@ function selectNextItemOnUp(templateItems, previousIndex)
selectItem
(
templateItems
,
previousIndex
-
1
);
selectItem
(
templateItems
,
previousIndex
-
1
);
}
}
}
}
function
confirmTemplateSelection
()
{
let
templateItems
=
document
.
querySelectorAll
(
'
.template-item:not(.hidden)
'
);
if
(
templateItems
.
length
===
0
)
{
selectedTemplateName
=
null
;
return
;
}
let
index
=
getIndexOfTemplateName
(
templateItems
,
selectedTemplateName
);
let
indexItemNoLongerInList
=
index
===
null
;
let
noItemSelected
=
selectedTemplateName
===
null
;
if
(
noItemSelected
||
indexItemNoLongerInList
)
{
return
;
}
templateItems
[
index
].
getElementsByClassName
(
'
button-select-template
'
)[
0
].
click
();
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/main/resources/templates/templates/templateFunctions.ftl
+
1
−
1
View file @
a25b95f4
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
<div class="collapsible-header-button">
<div class="collapsible-header-button">
<a href="<@s.url '/templates/$
{
template
.ID
?
c
}
/edit'/>" class="btn-flat no-padding text-color"><i class="material-icons left no-margin">edit</i></a>
<a href="<@s.url '/templates/$
{
template
.ID
?
c
}
/edit'/>" class="btn-flat no-padding text-color"><i class="material-icons left no-margin">edit</i></a>
<a href="<@s.url '/templates/$
{
template
.ID
?
c
}
/requestDelete'/>" class="btn-flat no-padding text-color"><i class="material-icons left no-margin">delete</i></a>
<a href="<@s.url '/templates/$
{
template
.ID
?
c
}
/requestDelete'/>" class="btn-flat no-padding text-color"><i class="material-icons left no-margin">delete</i></a>
<a href="<@s.url '/templates/$
{
template
.ID
?
c
}
/select'/>" class="waves-effect waves-light btn budgetmaster-blue"><i class="material-icons left no-margin">note_add</i></a>
<a href="<@s.url '/templates/$
{
template
.ID
?
c
}
/select'/>" class="waves-effect waves-light btn budgetmaster-blue
button-select-template
"><i class="material-icons left no-margin">note_add</i></a>
</div>
</div>
</div>
</div>
<div class="collapsible-body">
<div class="collapsible-body">
...
...
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