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
00bc665c
Commit
00bc665c
authored
3 years ago
by
Maximilian Giller
Browse files
Options
Downloads
Patches
Plain Diff
Added more hooks to make setting up interactions easier
parent
e48fe37b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
editor/js/tools/menus/collectmenu.js
+4
-4
4 additions, 4 deletions
editor/js/tools/menus/collectmenu.js
editor/js/tools/menus/toolmenu.js
+16
-0
16 additions, 0 deletions
editor/js/tools/menus/toolmenu.js
with
20 additions
and
4 deletions
editor/js/tools/menus/collectmenu.js
+
4
−
4
View file @
00bc665c
...
@@ -12,7 +12,6 @@ const DOM_LIST_ITEM = "li";
...
@@ -12,7 +12,6 @@ const DOM_LIST_ITEM = "li";
export
class
CollectMenu
extends
ToolMenu
{
export
class
CollectMenu
extends
ToolMenu
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
hooked
=
false
;
}
}
hookClearButton
()
{
hookClearButton
()
{
...
@@ -22,12 +21,13 @@ export class CollectMenu extends ToolMenu {
...
@@ -22,12 +21,13 @@ export class CollectMenu extends ToolMenu {
});
});
}
}
afterSet
(
key
,
value
)
{
onMenuShow
(
initial
)
{
if
(
this
.
hooked
===
false
)
{
if
(
initial
)
{
this
.
hookClearButton
();
this
.
hookClearButton
();
this
.
hooked
=
true
;
}
}
}
afterSet
(
key
,
value
)
{
if
(
key
===
COLLECTION_KEY
)
{
if
(
key
===
COLLECTION_KEY
)
{
this
.
fillDomList
(
SELECTED_ITEMS_ID
,
value
,
this
.
itemListRenderer
);
this
.
fillDomList
(
SELECTED_ITEMS_ID
,
value
,
this
.
itemListRenderer
);
}
}
...
...
This diff is collapsed.
Click to expand it.
editor/js/tools/menus/toolmenu.js
+
16
−
0
View file @
00bc665c
...
@@ -4,6 +4,7 @@ export default class ToolMenu {
...
@@ -4,6 +4,7 @@ export default class ToolMenu {
constructor
()
{
constructor
()
{
this
.
warnings
=
false
;
this
.
warnings
=
false
;
this
.
values
=
{};
this
.
values
=
{};
this
.
initialShow
=
true
;
}
}
loadTool
(
tool
)
{
loadTool
(
tool
)
{
...
@@ -12,11 +13,26 @@ export default class ToolMenu {
...
@@ -12,11 +13,26 @@ export default class ToolMenu {
}
}
show
()
{
show
()
{
this
.
onMenuShow
(
this
.
initialShow
);
this
.
initialShow
=
false
;
this
.
getMenu
().
removeClass
(
"
hidden
"
);
this
.
getMenu
().
removeClass
(
"
hidden
"
);
}
}
hide
()
{
hide
()
{
this
.
getMenu
().
addClass
(
"
hidden
"
);
this
.
getMenu
().
addClass
(
"
hidden
"
);
this
.
onMenuHide
();
}
onMenuShow
(
initial
)
{
if
(
this
.
warnings
)
{
console
.
warn
(
'
Method "onMenuShow" not implemented.
'
);
}
}
onMenuHide
()
{
if
(
this
.
warnings
)
{
console
.
warn
(
'
Method "onMenuHide" not implemented.
'
);
}
}
}
beforeGet
(
key
)
{
beforeGet
(
key
)
{
...
...
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