From fdc0292a90b6d529901a730d20afcdec5001d70c Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sun, 9 Jun 2019 09:10:06 -0400 Subject: [PATCH] Add index to Api4Ctrl --- ext/afform/core/ang/afformCore/Api4Ctrl.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ext/afform/core/ang/afformCore/Api4Ctrl.js b/ext/afform/core/ang/afformCore/Api4Ctrl.js index 32ae530fd1..67fac36b4d 100644 --- a/ext/afform/core/ang/afformCore/Api4Ctrl.js +++ b/ext/afform/core/ang/afformCore/Api4Ctrl.js @@ -18,13 +18,14 @@ ctrl.entity = parts[0]; ctrl.action = parts[1]; ctrl.params = parts[2]; + ctrl.index = parts[3]; ctrl.result = {}; ctrl.loading = ctrl.firstLoad = true; ctrl.refresh = function refresh() { ctrl.loading = true; crmThrottle(function () { - return crmApi4(ctrl.entity, ctrl.action, ctrl.params) + return crmApi4(ctrl.entity, ctrl.action, ctrl.params, ctrl.index) .then(function (response) { ctrl.result = response; ctrl.loading = ctrl.firstLoad = false; @@ -39,7 +40,7 @@ var mode = $scope.affApi4Refresh ? $scope.affApi4Refresh : 'auto'; switch (mode) { - case 'auto': $scope.$watchCollection('affApi4Ctrl.params', ctrl.refresh); break; + case 'auto': $scope.$watch('affApi4Ctrl', ctrl.refresh, true); break; case 'init': ctrl.refresh(); break; case 'manual': break; default: throw 'Unrecognized refresh mode: '+ mode; -- 2.25.1