From 62b641d1793f8ee789e8e8f581ba3341368704a5 Mon Sep 17 00:00:00 2001 From: Romans Malinovskis Date: Fri, 28 Apr 2017 09:50:59 +0100 Subject: [PATCH] Make reload atomic --- js/src/plugins/reloadView.js | 9 ++++++++- src/jsReload.php | 7 ------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/js/src/plugins/reloadView.js b/js/src/plugins/reloadView.js index ab9b857d56..a1ce6a6805 100644 --- a/js/src/plugins/reloadView.js +++ b/js/src/plugins/reloadView.js @@ -4,6 +4,13 @@ export default class reloadView { constructor(element, options) { const $element = $(element); + $element.spinner({ + 'loaderText': '', + 'active': true, + 'inline': true, + 'centered': true, + 'replace': true}); + if(options.uri) { $.get(options.uri, options.uri_options, (data) => { $element.replaceWith(data); @@ -15,4 +22,4 @@ export default class reloadView { reloadView.DEFAULTS = { uri: null, uri_options: {}, -}; \ No newline at end of file +}; diff --git a/src/jsReload.php b/src/jsReload.php index c8e0fe09ce..89f770915f 100644 --- a/src/jsReload.php +++ b/src/jsReload.php @@ -32,13 +32,6 @@ public function __construct($view, $args = []) public function jsRender() { $final = (new jQuery($this->view)) - ->spinner([ - 'loaderText' => '', - 'active' => true, - 'inline' => true, - 'centered' => true, - 'replace' => true, - ]) ->reloadView( [ 'uri' => $this->cb->getURL(),