mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
only detach of bars tools if exist
This commit is contained in:
parent
23192a1772
commit
22f747c235
@ -1,43 +1,45 @@
|
|||||||
import ToolBarPlayer from "@components/Player/ToolBarPlayer"
|
import ToolBarPlayer from "@components/Player/ToolBarPlayer"
|
||||||
|
|
||||||
export default class PlayerUI {
|
export default class PlayerUI {
|
||||||
constructor(player) {
|
constructor(player) {
|
||||||
this.player = player
|
this.player = player
|
||||||
|
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
currentDomWindow = null
|
currentDomWindow = null
|
||||||
|
|
||||||
//
|
//
|
||||||
// UI Methods
|
// UI Methods
|
||||||
//
|
//
|
||||||
attachPlayerComponent() {
|
attachPlayerComponent() {
|
||||||
if (this.currentDomWindow) {
|
if (this.currentDomWindow) {
|
||||||
this.player.console.warn("EmbbededMediaPlayer already attached")
|
this.player.console.warn("EmbbededMediaPlayer already attached")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if (app.layout.tools_bar) {
|
if (app.layout.tools_bar) {
|
||||||
this.currentDomWindow = app.layout.tools_bar.attachRender("mediaPlayer", ToolBarPlayer, undefined, {
|
this.currentDomWindow = app.layout.tools_bar.attachRender(
|
||||||
position: "bottom",
|
"mediaPlayer",
|
||||||
})
|
ToolBarPlayer,
|
||||||
}
|
undefined,
|
||||||
}
|
{
|
||||||
|
position: "bottom",
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
detachPlayerComponent() {
|
detachPlayerComponent() {
|
||||||
if (!this.currentDomWindow) {
|
if (!this.currentDomWindow) {
|
||||||
this.player.console.warn("EmbbededMediaPlayer not attached")
|
this.player.console.warn("EmbbededMediaPlayer not attached")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!app.layout.tools_bar) {
|
if (app.layout.tools_bar) {
|
||||||
this.player.console.error("Tools bar not found")
|
app.layout.tools_bar.detachRender("mediaPlayer")
|
||||||
return false
|
}
|
||||||
}
|
|
||||||
|
|
||||||
app.layout.tools_bar.detachRender("mediaPlayer")
|
this.currentDomWindow = null
|
||||||
|
}
|
||||||
this.currentDomWindow = null
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user