mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 02:24:16 +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"
|
||||
|
||||
export default class PlayerUI {
|
||||
constructor(player) {
|
||||
this.player = player
|
||||
constructor(player) {
|
||||
this.player = player
|
||||
|
||||
return this
|
||||
}
|
||||
return this
|
||||
}
|
||||
|
||||
currentDomWindow = null
|
||||
currentDomWindow = null
|
||||
|
||||
//
|
||||
// UI Methods
|
||||
//
|
||||
attachPlayerComponent() {
|
||||
if (this.currentDomWindow) {
|
||||
this.player.console.warn("EmbbededMediaPlayer already attached")
|
||||
return false
|
||||
}
|
||||
//
|
||||
// UI Methods
|
||||
//
|
||||
attachPlayerComponent() {
|
||||
if (this.currentDomWindow) {
|
||||
this.player.console.warn("EmbbededMediaPlayer already attached")
|
||||
return false
|
||||
}
|
||||
|
||||
if (app.layout.tools_bar) {
|
||||
this.currentDomWindow = app.layout.tools_bar.attachRender("mediaPlayer", ToolBarPlayer, undefined, {
|
||||
position: "bottom",
|
||||
})
|
||||
}
|
||||
}
|
||||
if (app.layout.tools_bar) {
|
||||
this.currentDomWindow = app.layout.tools_bar.attachRender(
|
||||
"mediaPlayer",
|
||||
ToolBarPlayer,
|
||||
undefined,
|
||||
{
|
||||
position: "bottom",
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
detachPlayerComponent() {
|
||||
if (!this.currentDomWindow) {
|
||||
this.player.console.warn("EmbbededMediaPlayer not attached")
|
||||
return false
|
||||
}
|
||||
detachPlayerComponent() {
|
||||
if (!this.currentDomWindow) {
|
||||
this.player.console.warn("EmbbededMediaPlayer not attached")
|
||||
return false
|
||||
}
|
||||
|
||||
if (!app.layout.tools_bar) {
|
||||
this.player.console.error("Tools bar not found")
|
||||
return false
|
||||
}
|
||||
if (app.layout.tools_bar) {
|
||||
app.layout.tools_bar.detachRender("mediaPlayer")
|
||||
}
|
||||
|
||||
app.layout.tools_bar.detachRender("mediaPlayer")
|
||||
|
||||
this.currentDomWindow = null
|
||||
}
|
||||
}
|
||||
this.currentDomWindow = null
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user