Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fc-pregmod
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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
macaronideath
fc-pregmod
Commits
e702a5f1
Commit
e702a5f1
authored
4 years ago
by
Arkerthan
Browse files
Options
Downloads
Patches
Plain Diff
add history back link to quick menu
parent
9c142581
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/gui/quicklinks.js
+20
-15
20 additions, 15 deletions
src/gui/quicklinks.js
with
20 additions
and
15 deletions
src/gui/quicklinks.js
+
20
−
15
View file @
e702a5f1
...
@@ -94,29 +94,34 @@ App.UI.quickMenu = (function() {
...
@@ -94,29 +94,34 @@ App.UI.quickMenu = (function() {
}
}
}
}
function
generateMenu
()
{
/**
if
(
!
jumpFrom
.
includes
(
State
.
passage
))
{
* @param {HTMLDivElement} container
hotkeysEnabled
=
false
;
*/
return
""
;
function
addBackLink
(
container
)
{
}
const
fragment
=
document
.
createDocumentFragment
();
// go back link
if
(
history
.
length
>
0
)
{
if
(
history
.
length
>
0
)
{
const
div
=
document
.
createElement
(
"
div
"
);
const
div
=
document
.
createElement
(
"
div
"
);
div
.
classList
.
add
(
"
menu-link
"
);
const
a
=
document
.
createElement
(
"
a
"
);
const
a
=
document
.
createElement
(
"
a
"
);
a
.
append
(
"
Back
"
);
a
.
append
(
"
Back
"
);
a
.
onclick
=
goBack
;
a
.
onclick
=
goBack
;
div
.
append
(
a
,
"
"
,
App
.
UI
.
DOM
.
makeElement
(
"
span
"
,
"
[delete]
"
,
"
hotkey
"
));
div
.
append
(
a
,
"
"
,
App
.
UI
.
DOM
.
makeElement
(
"
span
"
,
"
[backspace]
"
,
"
hotkey
"
));
fragment
.
append
(
div
);
// insert at second position
container
.
insertBefore
(
div
,
container
.
firstChild
.
nextSibling
);
}
}
function
generateMenu
()
{
if
(
!
jumpFrom
.
includes
(
State
.
passage
))
{
hotkeysEnabled
=
false
;
return
""
;
}
}
// quick menu
const
div
=
document
.
createElement
(
"
div
"
);
const
div
=
document
.
createElement
(
"
div
"
);
div
.
classList
.
add
(
"
quick-links
"
);
div
.
classList
.
add
(
"
quick-links
"
);
// quick menu
div
.
append
(
generateLinkList
(
layout
));
div
.
append
(
generateLinkList
(
layout
));
fragment
.
append
(
div
);
addBackLink
(
div
);
// traverse from current passage up to uncollapse.
// traverse from current passage up to uncollapse.
if
(
currentPassageDOM
!==
null
)
{
if
(
currentPassageDOM
!==
null
)
{
...
@@ -127,7 +132,7 @@ App.UI.quickMenu = (function() {
...
@@ -127,7 +132,7 @@ App.UI.quickMenu = (function() {
}
}
hotkeysEnabled
=
true
;
hotkeysEnabled
=
true
;
return
fragment
;
return
div
;
}
}
function
generateLinkList
(
group
)
{
function
generateLinkList
(
group
)
{
...
@@ -150,7 +155,7 @@ App.UI.quickMenu = (function() {
...
@@ -150,7 +155,7 @@ App.UI.quickMenu = (function() {
content
.
classList
.
add
(
"
content
"
);
content
.
classList
.
add
(
"
content
"
);
content
.
append
(
generateLinkList
(
group
));
content
.
append
(
generateLinkList
(
group
));
// wrap everything in one div, so we can control
it
by changing only one class
// wrap everything in one div, so we can control
collapsing
by changing only one class
const
wrapper
=
document
.
createElement
(
"
div
"
);
const
wrapper
=
document
.
createElement
(
"
div
"
);
wrapper
.
classList
.
add
(
"
collapsed
"
);
wrapper
.
classList
.
add
(
"
collapsed
"
);
toggle
.
onclick
=
()
=>
{
toggle
.
onclick
=
()
=>
{
...
...
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