Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
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
夏彬
jquery
Commits
91824bd2
Commit
91824bd2
authored
Mar 02, 2013
by
Rick Waldron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify data-* attr lookup with camelKey
Signed-off-by:
Rick Waldron
<
waldron.rick@gmail.com
>
parent
9bf8b040
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
data.js
src/data.js
+3
-4
No files found.
src/data.js
View file @
91824bd2
...
...
@@ -274,7 +274,7 @@ jQuery.fn.extend({
// Attempt to "discover" the data in
// HTML5 custom data-* attrs
data
=
dataAttr
(
elem
,
k
ey
,
undefined
);
data
=
dataAttr
(
elem
,
camelK
ey
,
undefined
);
if
(
data
!==
undefined
)
{
return
data
;
}
...
...
@@ -312,8 +312,7 @@ jQuery.fn.extend({
});
function
dataAttr
(
elem
,
key
,
data
)
{
var
name
,
camelKey
=
jQuery
.
camelCase
(
key
);
var
name
;
// If nothing was found internally, try to fetch any
// data from the HTML5 data-* attribute
...
...
@@ -334,7 +333,7 @@ function dataAttr( elem, key, data ) {
}
catch
(
e
)
{}
// Make sure we set the data so it isn't changed later
data_user
.
set
(
elem
,
camelK
ey
,
data
);
data_user
.
set
(
elem
,
k
ey
,
data
);
}
else
{
data
=
undefined
;
}
...
...
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