Skip to content

Commit

Permalink
feat: added a watch on block.layout.ColumnSpan and block.layout.RowSp…
Browse files Browse the repository at this point in the history
…an so that when resized the block will be re-rendered
  • Loading branch information
kevin9092 committed Sep 26, 2024
1 parent 38918c6 commit 48cc161
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,26 @@

var timeoutPromise;

$scope.$watch('block.layout.columnSpan', function (newValue, oldValue) {
if (newValue !== oldValue) {
$timeout.cancel(timeoutPromise);

timeoutPromise = $timeout(function () { //Set timeout
loadPreview(newValue, null);
}, 500);
}
}, true);

$scope.$watch('block.layout.rowSpan', function (newValue, oldValue) {
if (newValue !== oldValue) {
$timeout.cancel(timeoutPromise);

timeoutPromise = $timeout(function () { //Set timeout
loadPreview(newValue, null);
}, 500);
}
}, true);

$scope.$watch('block.data', function (newValue, oldValue) {
if (newValue !== oldValue) {
$timeout.cancel(timeoutPromise);
Expand Down

0 comments on commit 48cc161

Please sign in to comment.