File tree Expand file tree Collapse file tree
view/base/templates/script Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,6 +32,10 @@ if ($interval < 10) {
3232 component,
3333 update,
3434 });
35+
36+ if (component.lazyUpdate) {
37+
38+ }
3539 },
3640 run() {
3741 setInterval(async () => {
@@ -44,6 +48,15 @@ if ($interval < 10) {
4448 }
4549
4650 const requests = this.requests;
51+ const hasNonLazyUpdate = requests.some(request => request.component.lazyUpdate === false);
52+ if (false === hasNonLazyUpdate) {
53+ return;
54+ }
55+
56+ requests.forEach(request => {
57+ request.component.beforePost();
58+ });
59+
4760 this.requests = [];
4861
4962 await fetch('<?= $ escaper ->escapeUrl ($ componentUtil ->getPostUrl (
Original file line number Diff line number Diff line change @@ -59,15 +59,16 @@ $componentUtil = $viewModelFactory->create(ComponentUtil::class);
5959 value = this.value;
6060 }
6161
62+ return LokiAjaxQueue.add(this, value);
63+ },
64+ beforePost() {
6265 this.loading = true;
6366 this.setTargetStateOnPost();
6467 this.beforePostValue = this.value;
6568
6669 this.showLoaderTimerId = setTimeout(() => {
6770 this.showLoader = true;
6871 }, this.showLoaderTimeout);
69-
70- return LokiAjaxQueue.add(this, value);
7172 },
7273 afterPostSuccess() {
7374 if (!this.valid) {
You can’t perform that action at this time.
0 commit comments