mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix to text panel and transparent mode
This commit is contained in:
@@ -13,14 +13,15 @@ export class TextPanelCtrl extends PanelCtrl {
|
|||||||
mode : "markdown", // 'html', 'markdown', 'text'
|
mode : "markdown", // 'html', 'markdown', 'text'
|
||||||
content : "# title",
|
content : "# title",
|
||||||
};
|
};
|
||||||
/** @ngInject */
|
|
||||||
|
/** @ngInject **/
|
||||||
constructor($scope, $injector, private templateSrv, private $sce) {
|
constructor($scope, $injector, private templateSrv, private $sce) {
|
||||||
super($scope, $injector);
|
super($scope, $injector);
|
||||||
|
|
||||||
_.defaults(this.panel, this.panelDefaults);
|
_.defaults(this.panel, this.panelDefaults);
|
||||||
|
|
||||||
this.events.on('init-edit-mode', this.onInitEditMode.bind(this));
|
this.events.on('init-edit-mode', this.onInitEditMode.bind(this));
|
||||||
this.events.on('refresh', this.onRender.bind(this));
|
this.events.on('refresh', this.onRefresh.bind(this));
|
||||||
this.events.on('render', this.onRender.bind(this));
|
this.events.on('render', this.onRender.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,6 +30,10 @@ export class TextPanelCtrl extends PanelCtrl {
|
|||||||
this.editorTabIndex = 1;
|
this.editorTabIndex = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onRefresh() {
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
|
||||||
onRender() {
|
onRender() {
|
||||||
if (this.panel.mode === 'markdown') {
|
if (this.panel.mode === 'markdown') {
|
||||||
this.renderMarkdown(this.panel.content);
|
this.renderMarkdown(this.panel.content);
|
||||||
|
|||||||
Reference in New Issue
Block a user