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
04f381eb
Commit
04f381eb
authored
Jan 30, 2014
by
Paul Klimov
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:yiisoft/yii2
parents
518954da
afefcd6e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
58 deletions
+67
-58
jquery.pjax.js
framework/assets/pjax/jquery.pjax.js
+58
-57
Pjax.php
framework/widgets/Pjax.php
+9
-1
No files found.
framework/assets/pjax/jquery.pjax.js
View file @
04f381eb
This diff is collapsed.
Click to expand it.
framework/widgets/Pjax.php
View file @
04f381eb
...
@@ -50,10 +50,16 @@ class Pjax extends Widget
...
@@ -50,10 +50,16 @@ class Pjax extends Widget
/**
/**
* @var string the jQuery selector of the links that should trigger pjax requests.
* @var string the jQuery selector of the links that should trigger pjax requests.
* If not set, all links within the enclosed content of Pjax will trigger pjax requests.
* If not set, all links within the enclosed content of Pjax will trigger pjax requests.
* Note that
the pjax response to a link
is a full page, a normal request will be sent again.
* Note that
if the response to the pjax request
is a full page, a normal request will be sent again.
*/
*/
public
$linkSelector
;
public
$linkSelector
;
/**
/**
* @var string the jQuery selector of the forms whose submissions should trigger pjax requests.
* If not set, all forms with `data-pjax` attribute within the enclosed content of Pjax will trigger pjax requests.
* Note that if the response to the pjax request is a full page, a normal request will be sent again.
*/
public
$formSelector
;
/**
* @var boolean whether to enable push state.
* @var boolean whether to enable push state.
*/
*/
public
$enablePushState
=
true
;
public
$enablePushState
=
true
;
...
@@ -148,9 +154,11 @@ class Pjax extends Widget
...
@@ -148,9 +154,11 @@ class Pjax extends Widget
$this
->
clientOptions
[
'timeout'
]
=
$this
->
timeout
;
$this
->
clientOptions
[
'timeout'
]
=
$this
->
timeout
;
$options
=
Json
::
encode
(
$this
->
clientOptions
);
$options
=
Json
::
encode
(
$this
->
clientOptions
);
$linkSelector
=
Json
::
encode
(
$this
->
linkSelector
!==
null
?
$this
->
linkSelector
:
'#'
.
$id
.
' a'
);
$linkSelector
=
Json
::
encode
(
$this
->
linkSelector
!==
null
?
$this
->
linkSelector
:
'#'
.
$id
.
' a'
);
$formSelector
=
Json
::
encode
(
$this
->
formSelector
!==
null
?
$this
->
formSelector
:
'#'
.
$id
.
' form[data-pjax]'
);
$view
=
$this
->
getView
();
$view
=
$this
->
getView
();
PjaxAsset
::
register
(
$view
);
PjaxAsset
::
register
(
$view
);
$js
=
"jQuery(document).pjax(
$linkSelector
,
\"
#
$id
\"
,
$options
);"
;
$js
=
"jQuery(document).pjax(
$linkSelector
,
\"
#
$id
\"
,
$options
);"
;
$js
.=
"jQuery(document).on('submit',
$formSelector
, function (event) {jQuery.pjax.submit(event, '#
$id
');});"
;
$view
->
registerJs
(
$js
);
$view
->
registerJs
(
$js
);
}
}
}
}
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