mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-26 08:04:56 +01:00
Fix bug on contructor inialization on ColorPalettePanel.
This commit is contained in:
parent
d76ae3a5e3
commit
9c9dcabd37
@ -21,9 +21,12 @@ import ToolbarPaneItem from './ToolbarPaneItem';
|
|||||||
|
|
||||||
class ColorPalettePanel extends ToolbarPaneItem {
|
class ColorPalettePanel extends ToolbarPaneItem {
|
||||||
constructor(buttonId, model, baseUrl) {
|
constructor(buttonId, model, baseUrl) {
|
||||||
super(buttonId, model);
|
|
||||||
this._baseUrl = baseUrl;
|
|
||||||
$assert($defined(baseUrl), 'baseUrl can not be null');
|
$assert($defined(baseUrl), 'baseUrl can not be null');
|
||||||
|
super(buttonId, model, (() => this._setUrl(baseUrl)));
|
||||||
|
}
|
||||||
|
|
||||||
|
_setUrl(baseUrl) {
|
||||||
|
this._baseUrl = baseUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
_load() {
|
_load() {
|
||||||
|
@ -20,11 +20,16 @@ import ToolbarItem from './ToolbarItem';
|
|||||||
import FloatingTip from './FloatingTip';
|
import FloatingTip from './FloatingTip';
|
||||||
|
|
||||||
class ToolbarPaneItem extends ToolbarItem {
|
class ToolbarPaneItem extends ToolbarItem {
|
||||||
constructor(buttonId, model) {
|
constructor(buttonId, model, lazyInit) {
|
||||||
$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;
|
||||||
|
Loading…
Reference in New Issue
Block a user