mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 00:32:29 -04:00
refactor(core): migrate OC.EventSource from jQuery to native API
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
8920dad2de
commit
6e29885128
1 changed files with 7 additions and 6 deletions
|
|
@ -4,7 +4,6 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import $ from 'jquery'
|
||||
import { getRequestToken } from './requesttoken.ts'
|
||||
|
||||
/**
|
||||
|
|
@ -42,16 +41,18 @@ function OCEventSource(src, data) {
|
|||
} else {
|
||||
const iframeId = 'oc_eventsource_iframe_' + OCEventSource.iframeCount
|
||||
OCEventSource.fallBackSources[OCEventSource.iframeCount] = this
|
||||
this.iframe = $('<iframe></iframe>')
|
||||
this.iframe.attr('id', iframeId)
|
||||
this.iframe.hide()
|
||||
const iframe = document.createElement('iframe')
|
||||
iframe.id = iframeId
|
||||
iframe.style.display = 'none'
|
||||
|
||||
joinChar = '&'
|
||||
if (src.indexOf('?') === -1) {
|
||||
joinChar = '?'
|
||||
}
|
||||
this.iframe.attr('src', src + joinChar + 'fallback=true&fallback_id=' + OCEventSource.iframeCount + '&' + dataStr)
|
||||
$('body').append(this.iframe)
|
||||
iframe.src = src + joinChar + 'fallback=true&fallback_id=' + OCEventSource.iframeCount + '&' + dataStr
|
||||
|
||||
this.iframe = iframe
|
||||
document.body.appendChild(this.iframe)
|
||||
this.useFallBack = true
|
||||
OCEventSource.iframeCount++
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue