Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
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
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
Main
Synchronet
Commits
d0e44c97
Commit
d0e44c97
authored
1 year ago
by
Eric Oulashin
Browse files
Options
Downloads
Patches
Plain Diff
DDLightbarMenu: Fix to enable wrap navigation again, and fixed a comment about titlebar text
parent
a775092c
No related branches found
No related tags found
1 merge request
!371
DDLightbarMenu: Fix to enable wrap navigation again, and fixed a comment about titlebar text
Pipeline
#4935
passed
1 year ago
Stage: build
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
exec/load/dd_lightbar_menu.js
+40
-1
40 additions, 1 deletion
exec/load/dd_lightbar_menu.js
with
40 additions
and
1 deletion
exec/load/dd_lightbar_menu.js
+
40
−
1
View file @
d0e44c97
...
@@ -13,7 +13,7 @@ By default, this menu library does not display a border around the menu.
...
@@ -13,7 +13,7 @@ By default, this menu library does not display a border around the menu.
If you want this library to draw a border around the menu, you can set the
If you want this library to draw a border around the menu, you can set the
borderEnabled property to true. Without a border, the menu gains 2
borderEnabled property to true. Without a border, the menu gains 2
characters of width and 2 lines of height. If using a border, a title (text)
characters of width and 2 lines of height. If using a border, a title (text)
can be displayed in the top border by setting the
menuTitle
property (it
can be displayed in the top border by setting the
topBorderText
property (it
defaults to an empty string, for no title).
defaults to an empty string, for no title).
This script provides an object, DDLightbarMenu. Use the DDLightbarMenu
This script provides an object, DDLightbarMenu. Use the DDLightbarMenu
...
@@ -2204,6 +2204,7 @@ function DDLightbarMenu_DoKeyUp(pSelectedItemIndexes, pNumItems)
...
@@ -2204,6 +2204,7 @@ function DDLightbarMenu_DoKeyUp(pSelectedItemIndexes, pNumItems)
// last item.
// last item.
// If there are unselectable items above the current one, then scroll the item list up before
// If there are unselectable items above the current one, then scroll the item list up before
// wrapping down to the last selectable item
// wrapping down to the last selectable item
/*
var canWrapNav = false;
var canWrapNav = false;
if (this.allowUnselectableItems && this.selectedItemIdx > 0)
if (this.allowUnselectableItems && this.selectedItemIdx > 0)
{
{
...
@@ -2215,6 +2216,22 @@ function DDLightbarMenu_DoKeyUp(pSelectedItemIndexes, pNumItems)
...
@@ -2215,6 +2216,22 @@ function DDLightbarMenu_DoKeyUp(pSelectedItemIndexes, pNumItems)
else
else
canWrapNav = true;
canWrapNav = true;
}
}
*/
var
canWrapNav
=
true
;
if
(
this
.
allowUnselectableItems
)
{
canWrapNav
=
false
;
if
(
this
.
selectedItemIdx
>
0
)
{
if
(
this
.
topItemIdx
>
0
)
{
--
this
.
topItemIdx
;
this
.
Draw
(
selectedItemIndexes
);
}
else
canWrapNav
=
true
;
}
}
if
(
canWrapNav
&&
this
.
wrapNavigation
)
if
(
canWrapNav
&&
this
.
wrapNavigation
)
{
{
// If there are more items than can fit on the menu, then ideally, the top
// If there are more items than can fit on the menu, then ideally, the top
...
@@ -2288,6 +2305,7 @@ function DDLightbarMenu_DoKeyDown(pSelectedItemIndexes, pNumItems)
...
@@ -2288,6 +2305,7 @@ function DDLightbarMenu_DoKeyDown(pSelectedItemIndexes, pNumItems)
// then go to the first item.
// then go to the first item.
// If there are unselectable items below the current one, then scroll the item down up before
// If there are unselectable items below the current one, then scroll the item down up before
// wrapping up to the first selectable item
// wrapping up to the first selectable item
/*
var canWrapNav = false;
var canWrapNav = false;
if (this.allowUnselectableItems && this.selectedItemIdx > 0)
if (this.allowUnselectableItems && this.selectedItemIdx > 0)
{
{
...
@@ -2304,6 +2322,27 @@ function DDLightbarMenu_DoKeyDown(pSelectedItemIndexes, pNumItems)
...
@@ -2304,6 +2322,27 @@ function DDLightbarMenu_DoKeyDown(pSelectedItemIndexes, pNumItems)
else
else
canWrapNav = true;
canWrapNav = true;
}
}
*/
var
canWrapNav
=
true
;
if
(
this
.
allowUnselectableItems
)
{
canWrapNav
=
false
;
if
(
this
.
selectedItemIdx
>
0
)
{
var
topIndexForLastPage
=
numItems
-
this
.
GetNumItemsPerPage
();
if
(
topIndexForLastPage
<
0
)
topIndexForLastPage
=
0
;
else
if
(
topIndexForLastPage
>=
numItems
)
topIndexForLastPage
=
numItems
-
1
;
if
(
this
.
topItemIdx
<
topIndexForLastPage
)
{
++
this
.
topItemIdx
;
this
.
Draw
(
selectedItemIndexes
);
}
else
canWrapNav
=
true
;
}
}
if
(
canWrapNav
&&
this
.
wrapNavigation
)
if
(
canWrapNav
&&
this
.
wrapNavigation
)
{
{
// If there are more items than can fit on the menu, then ideally, the top
// If there are more items than can fit on the menu, then ideally, the top
...
...
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