mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-22 22:57:57 +01:00
Fix ColorPalettePanel initialization
This commit is contained in:
parent
36c974e34d
commit
e102b61c7d
@ -22,11 +22,9 @@ import ToolbarPaneItem from './ToolbarPaneItem';
|
|||||||
class ColorPalettePanel extends ToolbarPaneItem {
|
class ColorPalettePanel extends ToolbarPaneItem {
|
||||||
constructor(buttonId, model, baseUrl) {
|
constructor(buttonId, model, baseUrl) {
|
||||||
$assert($defined(baseUrl), 'baseUrl can not be null');
|
$assert($defined(baseUrl), 'baseUrl can not be null');
|
||||||
super(buttonId, model, (() => this._setUrl(baseUrl)));
|
super(buttonId, model, true);
|
||||||
}
|
|
||||||
|
|
||||||
_setUrl(baseUrl) {
|
|
||||||
this._baseUrl = baseUrl;
|
this._baseUrl = baseUrl;
|
||||||
|
super._init();
|
||||||
}
|
}
|
||||||
|
|
||||||
_load() {
|
_load() {
|
||||||
|
@ -20,20 +20,17 @@ import ToolbarItem from './ToolbarItem';
|
|||||||
import FloatingTip from './FloatingTip';
|
import FloatingTip from './FloatingTip';
|
||||||
|
|
||||||
class ToolbarPaneItem extends ToolbarItem {
|
class ToolbarPaneItem extends ToolbarItem {
|
||||||
constructor(buttonId, model, lazyInit) {
|
constructor(buttonId, model, delayInit) {
|
||||||
$assert(buttonId, 'buttonId can not be null');
|
$assert(buttonId, 'buttonId can not be null');
|
||||||
$assert(model, 'model can not be null');
|
$assert(model, 'model can not be null');
|
||||||
super(buttonId, null, { topicAction: true, relAction: false });
|
super(buttonId, null, { topicAction: true, relAction: false });
|
||||||
|
|
||||||
// delay initialization in case of bring required.
|
|
||||||
if (lazyInit) {
|
|
||||||
lazyInit.bind(this)();
|
|
||||||
}
|
|
||||||
|
|
||||||
const handler = () => (this.isVisible() ? this.hide() : this.show());
|
const handler = () => (this.isVisible() ? this.hide() : this.show());
|
||||||
this.setEventHandler(handler);
|
this.setEventHandler(handler);
|
||||||
this._model = model;
|
this._model = model;
|
||||||
|
if (!delayInit) {
|
||||||
this._panelElem = this._init();
|
this._panelElem = this._init();
|
||||||
|
}
|
||||||
this._visible = false;
|
this._visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user