Skip to content

Commit

Permalink
Merge pull request #115 from JacksonTian/mobile
Browse files Browse the repository at this point in the history
兼容Zepto
  • Loading branch information
JacksonTian committed Jan 30, 2013
2 parents dfcf3b7 + a9d9847 commit 4236dd7
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lib/datav.js
@@ -1,4 +1,4 @@
/*global d3, _, $, jQuery, Raphael, EventProxy */
/*global d3, window, _, $, jQuery, Zepto, Raphael, EventProxy */
/*!
* DataV兼容定义
*/
Expand All @@ -14,6 +14,7 @@
*/
var DataV = function () {};

var DOM = window.jQuery || window.Zepto;
/**
* 版本号
*/
Expand Down Expand Up @@ -376,12 +377,12 @@
return ret;
};

jQuery.fn.wall = function () {
DOM.fn.wall = function () {
return $(this).each(function () {
$(this).css('visibility', 'hidden');
});
};
jQuery.fn.unwall = function () {
DOM.fn.unwall = function () {
return $(this).each(function () {
$(this).css('visibility', 'visible');
});
Expand Down Expand Up @@ -487,7 +488,7 @@
ret = document.getElementById(node);
} else if (node.nodeName) { //DOM-element
ret = node;
} else if (node instanceof jQuery && node.size() > 0) {
} else if (node.size() > 0) {
ret = node[0];
}
if (!ret) {
Expand Down Expand Up @@ -620,7 +621,7 @@
var container;

var floatTag = function (cont) {
container = cont;
container = $(cont);
jqNode = $("<div/>").css({
"border": "1px solid",
"border-color": $.browser.msie ? "rgb(0, 0, 0)" : "rgba(0, 0, 0, 0.8)",
Expand All @@ -638,8 +639,9 @@
"visibility": "hidden",
"position": "absolute"
});
$(container).append(jqNode)
.mousemove(_mousemove);
container.append(jqNode);
container.on('mousemove', _mousemove);
container.on('tap', _mousemove);
jqNode.creator = floatTag;
return jqNode;
};
Expand Down

0 comments on commit 4236dd7

Please sign in to comment.