Skip to content

Commit

Permalink
allow to disabled timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
albertborsos committed Jan 17, 2019
1 parent e56caf1 commit da22ef0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/widgets/Pjax.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ public function registerClientScript()
}
$options = Json::htmlEncode($this->clientOptions);
$js = '';
if ($this->timeout === false) {
$js .= "jQuery('#$id').on('pjax:timeout', function(e) { e.preventDefault(); });";
unset($this->clientOptions['timeout']);
}
if ($this->linkSelector !== false) {
$linkSelector = Json::htmlEncode($this->linkSelector !== null ? $this->linkSelector : '#' . $id . ' a');
$js .= "jQuery(document).pjax($linkSelector, $options);";
Expand Down

0 comments on commit da22ef0

Please sign in to comment.