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
8d082c11
Commit
8d082c11
authored
Sep 16, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #5050.
parent
583c660c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
yii.js
framework/assets/yii.js
+15
-8
No files found.
framework/assets/yii.js
View file @
8d082c11
...
...
@@ -118,18 +118,23 @@ yii = (function ($) {
* For other elements, either the containing form action or the current page URL will be used
* as the form action URL.
*
* If the `data-method` attribute is not defined, nothing will be done.
* If the `data-method` attribute is not defined, the `href` attribute (if any) of the element
* will be assigned to `window.location`.
*
* @param $e the jQuery representation of the element
*/
handleAction
:
function
(
$e
)
{
var
method
=
$e
.
data
(
'method'
);
var
method
=
$e
.
data
(
'method'
),
$form
=
$e
.
closest
(
'form'
),
action
=
$e
.
attr
(
'href'
);
if
(
method
===
undefined
)
{
if
(
action
&&
action
!=
'#'
)
{
window
.
location
=
action
;
}
return
;
}
var
$form
=
$e
.
closest
(
'form'
);
var
action
=
$e
.
attr
(
'href'
);
var
newForm
=
!
$form
.
length
||
action
&&
action
!=
'#'
;
if
(
newForm
)
{
if
(
!
action
||
!
action
.
match
(
/
(
^
\/
|:
\/\/)
/
))
{
...
...
@@ -227,12 +232,14 @@ yii = (function ($) {
function
initDataMethods
()
{
var
handler
=
function
(
event
)
{
var
$this
=
$
(
this
);
// data-confirm requires data-method
if
(
$this
.
data
(
'method'
)
===
undefined
)
{
var
$this
=
$
(
this
),
method
=
$this
.
data
(
'method'
),
message
=
$this
.
data
(
'confirm'
);
if
(
method
===
undefined
&&
message
===
undefined
)
{
return
true
;
}
var
message
=
$this
.
data
(
'confirm'
);
if
(
message
!==
undefined
)
{
pub
.
confirm
(
message
,
function
()
{
pub
.
handleAction
(
$this
);
...
...
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