FIX: Don't error when clicking on a custom link in community section (#22174)

This commit is contained in:
Osama Sayegh 2023-06-20 11:35:33 +03:00 committed by GitHub
parent fc199d42fa
commit cee15d4177
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 6 deletions

View File

@ -17,11 +17,15 @@
@prefixValue={{link.prefixValue}} @prefixValue={{link.prefixValue}}
@href={{link.value}} @href={{link.value}}
@class={{link.linkDragCss}} @class={{link.linkDragCss}}
{{draggable {{(if
didStartDrag=link.didStartDrag this.section.reorderable
didEndDrag=link.didEndDrag (modifier
dragMove=link.dragMove "draggable"
}} didStartDrag=link.didStartDrag
didEndDrag=link.didEndDrag
dragMove=link.dragMove
)
)}}
/> />
{{else}} {{else}}
<Sidebar::SectionLink <Sidebar::SectionLink
@ -43,7 +47,7 @@
@currentWhen={{link.currentWhen}} @currentWhen={{link.currentWhen}}
@class={{link.linkDragCss}} @class={{link.linkDragCss}}
{{(if {{(if
link.didStartDrag this.section.reorderable
(modifier (modifier
"draggable" "draggable"
didStartDrag=link.didStartDrag didStartDrag=link.didStartDrag

View File

@ -44,6 +44,8 @@ export default class CommunitySection {
@tracked links; @tracked links;
@tracked moreLinks; @tracked moreLinks;
reorderable = false;
constructor({ section, owner }) { constructor({ section, owner }) {
setOwner(this, owner); setOwner(this, owner);

View File

@ -14,6 +14,8 @@ export default class Section {
@tracked dragCss; @tracked dragCss;
@tracked links; @tracked links;
reorderable = true;
constructor({ section, owner }) { constructor({ section, owner }) {
setOwner(this, owner); setOwner(this, owner);