Skip to content

Commit

Permalink
Merge pull request #21 from cruzcraul/master
Browse files Browse the repository at this point in the history
Adding support to set the timeout in the pjax call
  • Loading branch information
loveorigami authored Jan 24, 2019
2 parents 0f7e435 + e215742 commit d6bc514
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ModalAjax.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ class ModalAjax extends Modal
*/
public $pjaxContainer;

/**
* timeout in miliseconds for pjax call
*
* @var string
*/
public $pjaxTimeout = 1000;

/**
* Submit the form via ajax
*
Expand Down Expand Up @@ -196,7 +203,7 @@ protected function defaultSubmitEvent()
}

if ($this->pjaxContainer) {
$expression[] = "$.pjax.reload({container : '$this->pjaxContainer'});";
$expression[] = "$.pjax.reload({container : '$this->pjaxContainer', timeout : $this->pjaxTimeout });";
}

$script = implode("\r\n", $expression);
Expand Down

0 comments on commit d6bc514

Please sign in to comment.