Skip to content

Commit

Permalink
Removed unneeded batchUpdate code
Browse files Browse the repository at this point in the history
  • Loading branch information
ranbena committed Apr 14, 2019
1 parent eef107c commit 7ef0ab1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
12 changes: 4 additions & 8 deletions client/app/components/dashboards/gridstack/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,7 @@ function gridstack($parse, dashboardGridOptions) {
};
},
link: ($scope, $element, $attr, controller) => {
const batchUpdateAssignable = _.isFunction($parse($attr.batchUpdate).assign);
const isOneColumnModeAssignable = _.isFunction($parse($attr.batchUpdate).assign);

const isOneColumnModeAssignable = _.isFunction($parse($attr.onLayoutChanged).assign);
let enablePolling = true;

$element.addClass('grid-stack');
Expand Down Expand Up @@ -240,7 +238,9 @@ function gridstack($parse, dashboardGridOptions) {
$(node.el).trigger('gridstack.changed', node);
}
});
$scope.onLayoutChanged();
if ($scope.onLayoutChanged) {
$scope.onLayoutChanged();
}
changedNodes = {};
});

Expand All @@ -256,10 +256,6 @@ function gridstack($parse, dashboardGridOptions) {
controller.setEditing(!!value);
});

if (batchUpdateAssignable) {
$scope.batchUpdate = controller.batchUpdateWidgets;
}

$scope.$on('$destroy', () => {
enablePolling = false;
controller.$el = null;
Expand Down
4 changes: 2 additions & 2 deletions client/app/pages/dashboards/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ <h3>
</div>

<div style="padding-bottom: 5px;" ng-if="$ctrl.dashboard.widgets.length > 0">
<div gridstack editing="$ctrl.layoutEditing" batch-update="$ctrl.updateGridItems"
is-one-column-mode="$ctrl.isGridDisabled" class="dashboard-wrapper" on-layout-changed="$ctrl.onLayoutChanged"
<div gridstack editing="$ctrl.layoutEditing" on-layout-changed="$ctrl.onLayoutChanged"
is-one-column-mode="$ctrl.isGridDisabled" class="dashboard-wrapper"
ng-class="{'preview-mode': !$ctrl.layoutEditing, 'editing-mode': $ctrl.layoutEditing}">
<div class="dashboard-widget-wrapper"
ng-repeat="widget in $ctrl.dashboard.widgets track by widget.id"
Expand Down

0 comments on commit 7ef0ab1

Please sign in to comment.