Skip to content

Commit

Permalink
Merge pull request #49924 from nextcloud/fix/link-share-conflict-modal
Browse files Browse the repository at this point in the history
fix(share): render conflict modal in public shares
  • Loading branch information
max-nextcloud authored Dec 19, 2024
2 parents 7e57d0d + 38c9c73 commit e703507
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
11 changes: 10 additions & 1 deletion core/src/jquery/octemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const Template = {
},
// From stackoverflow.com/questions/1408289/best-way-to-do-variable-interpolation-in-javascript
_build(o) {
const data = this.elem.attr('type') === 'text/template' ? this.elem.html() : this.elem.get(0).outerHTML
const data = this._getData()
try {
return data.replace(/{([^{}]*)}/g,
function(a, b) {
Expand All @@ -95,6 +95,15 @@ const Template = {
console.error(e, 'data:', data)
}
},
_getData() {
if (this.elem.attr('type') === 'text/template') {
return this.elem.html()
}
// Leave out comments, etc and take the first html element
const htmlElem = $.makeArray(this.elem)
.find(e => e instanceof HTMLElement)
return htmlElem.outerHTML
},
options: {
escapeFunction: escapeHTML,
},
Expand Down
4 changes: 2 additions & 2 deletions dist/core-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-main.js.map

Large diffs are not rendered by default.

0 comments on commit e703507

Please sign in to comment.