Skip to content

Commit

Permalink
Adding support to set the timeout in the pjax call
Browse files Browse the repository at this point in the history
  • Loading branch information
cruzcraul committed Jan 24, 2019
1 parent 0f7e435 commit e215742
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 e215742

Please sign in to comment.