|
42 | 42 |
|
43 | 43 | let codeJarElement: HTMLPreElement | undefined |
44 | 44 |
|
45 | | - let lineWidthSlot: HTMLDivElement |
46 | | - let backgroundColorSlot: HTMLDivElement |
47 | | - let shadowSlot: HTMLDivElement |
48 | | - let alignmentSlot: HTMLDivElement |
49 | | - let seeThroughSlot: HTMLDivElement |
50 | | - let copyTextSlot: HTMLDivElement |
51 | | -
|
52 | 45 | let unsubFromText: (() => void) | undefined |
53 | 46 |
|
54 | 47 | const unsubFromEvent = EVENTS.UPDATE_SELECTION.subscribe(() => { |
|
79 | 72 | }) |
80 | 73 | }) |
81 | 74 |
|
| 75 | + const mountLineWidth = (node: HTMLDivElement) => { |
| 76 | + node.appendChild(TEXT_DISPLAY_WIDTH_SLIDER.node) |
| 77 | + } |
| 78 | + const mountShadow = (node: HTMLDivElement) => { |
| 79 | + node.appendChild(TEXT_DISPLAY_SHADOW_TOGGLE.node) |
| 80 | + } |
| 81 | + const mountAlignment = (node: HTMLDivElement) => { |
| 82 | + node.appendChild(TEXT_DISPLAY_ALIGNMENT_SELECT.node) |
| 83 | + } |
| 84 | + const mountSeeThrough = (node: HTMLDivElement) => { |
| 85 | + node.appendChild(TEXT_DISPLAY_SEE_THROUGH_TOGGLE.node) |
| 86 | + } |
| 87 | + const mountBackgroundColor = (node: HTMLDivElement) => { |
| 88 | + node.appendChild(TEXT_DISPLAY_BACKGROUND_COLOR_PICKER.node) |
| 89 | + } |
| 90 | + const mountCopyText = (node: HTMLDivElement) => { |
| 91 | + node.appendChild(TEXT_DISPLAY_COPY_TEXT_ACTION.node) |
| 92 | + } |
| 93 | +
|
82 | 94 | requestAnimationFrame(() => { |
83 | | - lineWidthSlot.appendChild(TEXT_DISPLAY_WIDTH_SLIDER.node) |
84 | | - backgroundColorSlot.appendChild(TEXT_DISPLAY_BACKGROUND_COLOR_PICKER.node) |
85 | | - shadowSlot.appendChild(TEXT_DISPLAY_SHADOW_TOGGLE.node) |
86 | | - alignmentSlot.appendChild(TEXT_DISPLAY_ALIGNMENT_SELECT.node) |
87 | | - seeThroughSlot.appendChild(TEXT_DISPLAY_SEE_THROUGH_TOGGLE.node) |
88 | | - copyTextSlot.appendChild(TEXT_DISPLAY_COPY_TEXT_ACTION.node) |
89 | 95 | forceNoWrap() |
90 | 96 | }) |
91 | 97 |
|
|
122 | 128 | class="toolbar text-display-toolbar" |
123 | 129 | style={!!selected ? '' : 'visibility:hidden; height: 0px;'} |
124 | 130 | > |
125 | | - <div class="content" bind:this={lineWidthSlot} /> |
126 | | - <div class="content" bind:this={backgroundColorSlot} /> |
127 | | - <div class="content" bind:this={shadowSlot} /> |
128 | | - <div class="content" bind:this={alignmentSlot} /> |
129 | | - <div class="content" bind:this={seeThroughSlot} /> |
130 | | - <div class="content" bind:this={copyTextSlot} /> |
| 131 | + <div class="content" use:mountLineWidth /> |
| 132 | + <div class="content" use:mountShadow /> |
| 133 | + <div class="content" use:mountAlignment /> |
| 134 | + <div class="content" use:mountSeeThrough /> |
| 135 | + <div class="content" use:mountBackgroundColor /> |
| 136 | + <div class="content" use:mountCopyText /> |
131 | 137 | </div> |
132 | 138 |
|
133 | 139 | <div |
|
0 commit comments