|
50 | 50 | </p> |
51 | 51 |
|
52 | 52 | <!-- add new share input --> |
53 | | - <SharingInput v-if="!loading && false" |
54 | | - :can-reshare="canReshare" |
55 | | - :file-info="fileInfo" |
56 | | - :link-shares="linkShares" |
57 | | - :reshare="reshare" |
58 | | - :shares="shares" |
59 | | - :is-shared-with-me="isSharedWithMe" |
60 | | - @open-sharing-details="toggleShareDetailsView" |
61 | | - @open-sharing-details-all="toggleShareDetailsViewAll" /> |
| 53 | + <SharingInput v-if="!loading && false" :can-reshare="canReshare" :file-info="fileInfo" |
| 54 | + :link-shares="linkShares" :reshare="reshare" :shares="shares" :is-shared-with-me="isSharedWithMe" |
| 55 | + @open-sharing-details="toggleShareDetailsView" @open-sharing-details-all="toggleShareDetailsViewAll" /> |
62 | 56 |
|
63 | 57 | <!-- link shares list --> |
64 | | - <SharingLinkList v-if="!loading" |
65 | | - ref="linkShareList" |
66 | | - :can-reshare="canReshare" |
67 | | - :file-info="fileInfo" |
68 | | - :shares="linkShares" |
69 | | - @open-sharing-details="toggleShareDetailsView" /> |
| 58 | + <SharingLinkList v-if="!loading" ref="linkShareList" :can-reshare="canReshare" :file-info="fileInfo" |
| 59 | + :shares="linkShares" @open-sharing-details="toggleShareDetailsView" /> |
70 | 60 |
|
71 | 61 | <!-- other shares list --> |
72 | | - <SharingList v-if="!loading && canReshare" |
73 | | - ref="shareList" |
74 | | - :shares="shares" |
75 | | - :file-info="fileInfo" |
| 62 | + <SharingList v-if="!loading && canReshare" ref="shareList" :shares="shares" :file-info="fileInfo" |
76 | 63 | @open-sharing-details="toggleShareDetailsView" /> |
77 | 64 |
|
78 | 65 | <OpenSharingButton v-if="canReshare" :file-info="fileInfo" /> |
79 | 66 | </div> |
80 | 67 |
|
81 | 68 | <!-- share details --> |
82 | 69 | <div v-else> |
83 | | - <SharingDetailsTab :file-info="shareDetailsData.fileInfo" |
84 | | - :share="shareDetailsData.share" |
85 | | - :share-all="shareDetailsDataAll" |
86 | | - :resharing-allowed-global="config.isResharingAllowed" |
87 | | - @close-sharing-details="toggleShareDetailsView" |
88 | | - @add:share="addShare" |
89 | | - @remove:share="removeShare" /> |
| 70 | + <SharingDetailsTab :file-info="shareDetailsData.fileInfo" :share="shareDetailsData.share" |
| 71 | + :share-all="shareDetailsDataAll" :resharing-allowed-global="config.isResharingAllowed" |
| 72 | + @close-sharing-details="toggleShareDetailsView" @add:share="addShare" @remove:share="removeShare" /> |
90 | 73 | </div> |
91 | 74 |
|
92 | 75 | <!-- additional entries, use it with cautious --> |
93 | | - <div v-for="(section, index) in sections" |
94 | | - :ref="'section-' + index" |
95 | | - :key="index" |
| 76 | + <div v-for="(section, index) in sections" :ref="'section-' + index" :key="index" |
96 | 77 | class="sharingTab__additionalContent"> |
97 | | - <component :is="section($refs['section-' + index], fileInfo)" |
98 | | - :file-info="fileInfo" /> |
| 78 | + <component :is="section($refs['section-' + index], fileInfo)" :file-info="fileInfo" /> |
99 | 79 | </div> |
100 | 80 | </div> |
101 | 81 | </template> |
@@ -186,41 +166,57 @@ export default { |
186 | 166 | return |
187 | 167 | } |
188 | 168 |
|
189 | | - const figureDiv = document.querySelector('.app-sidebar-header__figure') |
| 169 | + const figureDiv = document.getElementsByClassName('app-sidebar-header__figure')[0] |
190 | 170 | if (!figureDiv) { |
191 | 171 | return |
192 | 172 | } |
193 | 173 |
|
194 | | - const rawFolderImage = figureDiv.style.backgroundImage || getComputedStyle(figureDiv).backgroundImage |
195 | | - let folderUrl = (rawFolderImage && rawFolderImage !== 'none') |
196 | | - ? (rawFolderImage.trim().startsWith('url(') ? rawFolderImage.trim() : `url("${rawFolderImage.trim()}")`) |
197 | | - : null |
198 | | -
|
199 | | - if (folderUrl && folderUrl.includes('folder-shared.svg')) { |
200 | | - folderUrl = folderUrl.replace('folder-shared.svg', 'folder.svg') |
201 | | - } |
202 | | -
|
203 | 174 | const overlayLinkIcon = getComputedStyle(document.documentElement) |
204 | 175 | .getPropertyValue('--original-icon-folder-overlay-share-white') |
205 | 176 | .trim() |
206 | 177 |
|
207 | | - const applyOverlay = () => { |
208 | | - const composed = folderUrl ? `${overlayLinkIcon}, ${folderUrl}` : overlayLinkIcon |
209 | | - figureDiv.style.setProperty('background-image', composed, 'important') |
210 | | - figureDiv.style.setProperty('background-repeat', 'no-repeat, no-repeat', 'important') |
211 | | - figureDiv.style.setProperty('background-position', 'center, center', 'important') |
212 | | - figureDiv.style.setProperty('background-size', '2.1rem 2.5rem, contain', 'important') |
| 178 | + const overlayClass = 'nmcsharing-share-overlay' |
| 179 | + let overlayElement = figureDiv.querySelector(`.${overlayClass}`) |
| 180 | +
|
| 181 | + const ensureOverlayElement = () => { |
| 182 | + if (!overlayElement) { |
| 183 | + overlayElement = document.createElement('span') |
| 184 | + overlayElement.className = overlayClass |
| 185 | + overlayElement.style.position = 'absolute' |
| 186 | + overlayElement.style.inset = '0' |
| 187 | + overlayElement.style.pointerEvents = 'none' |
| 188 | + overlayElement.style.display = 'block' |
| 189 | + overlayElement.style.zIndex = '1' |
| 190 | + figureDiv.appendChild(overlayElement) |
| 191 | + } |
| 192 | +
|
| 193 | + const figurePosition = getComputedStyle(figureDiv).position |
| 194 | + if (figurePosition === 'static') { |
| 195 | + figureDiv.style.setProperty('position', 'relative', 'important') |
| 196 | + } |
| 197 | +
|
| 198 | + overlayElement.style.setProperty('background-image', overlayLinkIcon, 'important') |
| 199 | + overlayElement.style.setProperty('background-repeat', 'no-repeat', 'important') |
| 200 | + overlayElement.style.setProperty('background-position', 'center', 'important') |
| 201 | + overlayElement.style.setProperty('background-size', '2.1rem 2.5rem', 'important') |
| 202 | + return overlayElement |
| 203 | + } |
| 204 | +
|
| 205 | + const folderUrl = 'url("/customapps/nmctheme/img/filetypes/folder.svg")' |
| 206 | +
|
| 207 | + const restoreOriginalBackground = () => { |
| 208 | + figureDiv.style.setProperty('background-image', folderUrl, 'important') |
213 | 209 | } |
214 | 210 |
|
215 | | - // applyOverlay() |
216 | | - // window.requestAnimationFrame(applyOverlay) |
217 | 211 | setTimeout(() => { |
218 | 212 | if (file.mimetype === 'httpd/unix-directory') { |
219 | | - applyOverlay() |
| 213 | + restoreOriginalBackground() |
| 214 | + ensureOverlayElement() |
220 | 215 | } |
221 | 216 | }, 50) |
222 | 217 | }, |
223 | 218 |
|
| 219 | +
|
224 | 220 | /** |
225 | 221 | * Update current fileInfo and fetch new data |
226 | 222 | * |
@@ -474,7 +470,8 @@ export default { |
474 | 470 | &__content { |
475 | 471 | padding: 0px; |
476 | 472 |
|
477 | | - p, .sharing-entry__noshare { |
| 473 | + p, |
| 474 | + .sharing-entry__noshare { |
478 | 475 | margin-bottom: 1rem |
479 | 476 | } |
480 | 477 | } |
|
0 commit comments