feat(panels): more panel refactoring, using events instead of overriding base class methods

This commit is contained in:
Torkel Ödegaard
2016-03-23 12:50:56 +01:00
parent 6a42b95d39
commit b3c073ab6c
13 changed files with 111 additions and 77 deletions

View File

@@ -28,18 +28,18 @@ class DashListCtrl extends PanelCtrl {
this.panel.tags = [$scope.panel.tag];
delete this.panel.tag;
}
this.events.on('refresh', this.onRefresh.bind(this));
this.events.on('init-edit-mode', this.onInitEditMode.bind(this));
}
initEditMode() {
super.initEditMode();
onInitEditMode() {
this.editorTabIndex = 1;
this.modes = ['starred', 'search', 'recently viewed'];
this.icon = "fa fa-star";
this.addEditorTab('Options', () => {
return {templateUrl: 'public/app/plugins/panel/dashlist/editor.html'};
});
this.addEditorTab('Options', 'public/app/plugins/panel/dashlist/editor.html');
}
refresh() {
onRefresh() {
var params: any = {limit: this.panel.limit};
if (this.panel.mode === 'recently viewed') {