Skip to content

将注释移到函数外部 #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions data.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,34 +86,34 @@ define("data", ["lang"], function($) {
}
var rparse = /^(?:null|false|true|NaN|\{.*\}|\[.*\])$/;
$.mix({

//判定是否关联了数据
hasData: function(owner) {
//判定是否关联了数据

return owners.indexOf(owner) > -1;
},

//读写用户数据
data: function(target, name, data) {
//读写用户数据

return innerData(target, name, data);
},

//读写内部数据
_data: function(target, name, data) {
//读写内部数据

return innerData(target, name, data, true);
},

//删除用户数据
removeData: function(target, name) {
//删除用户数据

return innerRemoveData(target, name);
},

//移除内部数据
_removeData: function(target, name) {
//移除内部数据

return innerRemoveData(target, name, true);
},

//将HTML5 data-*的属性转换为更丰富有用的数据类型,并保存起来
parseData: function(target, name, cache, value) {
//将HTML5 data-*的属性转换为更丰富有用的数据类型,并保存起来

var data, _eval, key = $.String.camelize(name);
if(cache && (key in cache)) return cache[key];
if(arguments.length !== 4) {
Expand All @@ -136,9 +136,9 @@ define("data", ["lang"], function($) {
return data;

},

//合并数据
mergeData: function(cur, src) {
//合并数据

if($.hasData(cur)) {
var oldData = $._data(src),
curData = $._data(cur),
Expand Down