Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
823227fc
Commit
823227fc
authored
Jan 29, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Pjax::timeout and clientOptions.
parent
f5f5538d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
Pjax.php
framework/widgets/Pjax.php
+13
-4
No files found.
framework/widgets/Pjax.php
View file @
823227fc
...
...
@@ -58,6 +58,15 @@ class Pjax extends Widget
* @var boolean whether to enable replace state.
*/
public
$enableReplaceState
=
false
;
/**
* @var integer pjax timeout setting (in milliseconds)
*/
public
$timeout
=
1000
;
/**
* @var array additional options to be passed to the pjax JS plugin. Please refer to
* [pjax project page](https://github.com/defunkt/jquery-pjax) for available options.
*/
public
$clientOptions
;
/**
* @inheritdoc
...
...
@@ -131,10 +140,10 @@ class Pjax extends Widget
public
function
registerClientScript
()
{
$id
=
$this
->
options
[
'id'
];
$
options
=
Json
::
encode
([
'push'
=>
$this
->
enablePushState
,
'replace'
=>
$this
->
enableReplaceState
,
]
);
$
this
->
clientOptions
[
'push'
]
=
$this
->
enablePushState
;
$this
->
clientOptions
[
'replace'
]
=
$this
->
enableReplaceState
;
$this
->
clientOptions
[
'timeout'
]
=
$this
->
timeout
;
$options
=
Json
::
encode
(
$this
->
clientOptions
);
$linkSelector
=
Json
::
encode
(
$this
->
linkSelector
!==
null
?
$this
->
linkSelector
:
'#'
.
$id
.
' a'
);
$view
=
$this
->
getView
();
PjaxAsset
::
register
(
$view
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment