Commit a3e13b33 by Johannes Schill

fix: Text panel should re-render when panel mode is changed #14922

parent 9c8dea06
......@@ -33,11 +33,19 @@ export class TextPanelCtrl extends PanelCtrl {
this.events.on('refresh', this.onRefresh.bind(this));
this.events.on('render', this.onRender.bind(this));
const renderWhenChanged = (scope: any) => {
const { panel } = scope.ctrl;
return [
panel.content,
panel.mode
].join();
};
$scope.$watch(
'ctrl.panel.content',
renderWhenChanged,
_.throttle(() => {
this.render();
}, 1000)
}, 1000, {trailing: true})
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment