Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Knowledge Space WP Plugin
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
alg
Knowledge Space WP Plugin
Commits
74fcfba3
Commit
74fcfba3
authored
3 years ago
by
Maximilian Giller
Browse files
Options
Downloads
Patches
Plain Diff
Expaneded menu interface for value exchange
parent
717b613a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
editor/js/tools/menus/toolmenu.js
+55
-2
55 additions, 2 deletions
editor/js/tools/menus/toolmenu.js
with
55 additions
and
2 deletions
editor/js/tools/menus/toolmenu.js
+
55
−
2
View file @
74fcfba3
...
@@ -4,13 +4,66 @@ export default class ToolMenu {
...
@@ -4,13 +4,66 @@ export default class ToolMenu {
constructor
(
tool
)
{
constructor
(
tool
)
{
this
.
tool
=
tool
;
this
.
tool
=
tool
;
this
.
menuId
=
this
.
tool
.
getKey
()
+
"
-menu
"
;
this
.
menuId
=
this
.
tool
.
getKey
()
+
"
-menu
"
;
this
.
warnings
=
false
;
this
.
values
=
{};
}
}
show
()
{
show
()
{
jQuery
(
"
#
"
+
this
.
m
enu
Id
).
removeClass
(
"
hidden
"
);
this
.
getM
enu
(
).
removeClass
(
"
hidden
"
);
}
}
hide
()
{
hide
()
{
jQuery
(
"
#
"
+
this
.
menuId
).
addClass
(
"
hidden
"
);
this
.
getMenu
().
addClass
(
"
hidden
"
);
}
beforeGet
(
key
)
{
if
(
this
.
warnings
)
{
console
.
warn
(
'
Method "beforeGet" not implemented.
'
);
}
}
afterSet
(
key
,
value
)
{
if
(
this
.
warnings
)
{
console
.
warn
(
'
Method "afterSet" not implemented.
'
);
}
}
value
(
key
,
newValue
)
{
// If key not defined
// (be it by giving no arguments, or giving it an undefined value)
// Return all values as dict.
if
(
key
===
undefined
)
{
return
this
.
values
;
}
// Is key valid?
// If not, create undefined entry
if
(
key
in
this
.
values
==
false
)
{
this
.
values
[
key
]
=
undefined
;
}
// If value not defined, returned specified value.
if
(
newValue
===
undefined
)
{
newValue
=
this
.
beforeGet
(
key
);
if
(
newValue
!==
undefined
)
{
this
.
values
[
key
]
=
newValue
;
}
return
this
.
values
[
key
];
}
// If bot defined, store specified value.
else
{
this
.
values
[
key
]
=
newValue
;
newValue
=
this
.
afterSet
(
key
,
newValue
);
}
}
getChildren
(
selector
)
{
return
this
.
getMenu
().
children
(
selector
);
}
getMenu
()
{
return
jQuery
(
"
#tool-menu #
"
+
this
.
menuId
);
}
}
}
}
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