WIP: refactor folder-picker for dashlist

This commit is contained in:
Daniel Lee
2017-06-01 23:32:33 +02:00
parent c602afb9c6
commit 533f2d3d72
7 changed files with 42 additions and 15 deletions

View File

@@ -12,6 +12,7 @@ class DashListCtrl extends PanelCtrl {
modes: any[];
panelDefaults = {
folder: '',
query: '',
limit: 10,
tags: [],
@@ -19,6 +20,7 @@ class DashListCtrl extends PanelCtrl {
search: false,
starred: true,
headings: true,
folderId: 0
};
/** @ngInject */
@@ -87,6 +89,7 @@ class DashListCtrl extends PanelCtrl {
limit: this.panel.limit,
query: this.panel.query,
tag: this.panel.tags,
folderId: this.panel.folderId
};
return this.backendSrv.search(params).then(result => {
@@ -123,6 +126,11 @@ class DashListCtrl extends PanelCtrl {
});
});
}
onFolderChange(parentId) {
this.$scope.$parent.ctrl.panel.folderId = parentId;
this.$scope.$parent.ctrl.refresh();
}
}
export {DashListCtrl, DashListCtrl as PanelCtrl};