|
@@ -60,6 +60,10 @@ export class GridCtrl {
|
|
|
bindItem(element) {
|
|
bindItem(element) {
|
|
|
this.gridstack.makeWidget(element);
|
|
this.gridstack.makeWidget(element);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ removeItem(element) {
|
|
|
|
|
+ this.gridstack.removeWidget(element, false);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/** @ngInject **/
|
|
/** @ngInject **/
|
|
@@ -115,6 +119,13 @@ export function dashGridItem($timeout, $rootScope) {
|
|
|
element.addClass('panel-fullscreen');
|
|
element.addClass('panel-fullscreen');
|
|
|
}, scope);
|
|
}, scope);
|
|
|
|
|
|
|
|
|
|
+ scope.$on('$destroy', () => {
|
|
|
|
|
+ gridCtrl.removeItem(element);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // scope.onItemRemoved({item: item});
|
|
|
|
|
+ // ctrl.removeItem(element);
|
|
|
|
|
+
|
|
|
|
|
|
|
|
//var item = element.data('_gridstack_node');
|
|
//var item = element.data('_gridstack_node');
|
|
|
//console.log('link item', item);
|
|
//console.log('link item', item);
|