Skip to content

Commit

Permalink
Merge pull request #149 from atk4/feature/non-destructive-reload
Browse files Browse the repository at this point in the history
Make reload atomic
  • Loading branch information
romaninsh authored Apr 28, 2017
2 parents 2108eac + 62b641d commit 4288901
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
9 changes: 8 additions & 1 deletion js/src/plugins/reloadView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -15,4 +22,4 @@ export default class reloadView {
reloadView.DEFAULTS = {
uri: null,
uri_options: {},
};
};
7 changes: 0 additions & 7 deletions src/jsReload.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 4288901

Please sign in to comment.