Skip to content

Commit

Permalink
Dump 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pissang committed Jun 29, 2015
1 parent 09805df commit b519622
Show file tree
Hide file tree
Showing 13 changed files with 94 additions and 27 deletions.
91 changes: 76 additions & 15 deletions build/zrender-original.js
Original file line number Diff line number Diff line change
Expand Up @@ -1814,6 +1814,8 @@ define('zrender/config',[],function () {
touchClickDelay : 300
},

elementClassName: 'zr-element',

// 是否异常捕获
catchBrushException: false,

Expand Down Expand Up @@ -2771,6 +2773,22 @@ define(
'touchstart', 'touchend', 'touchmove'
];

var isZRenderElement = function (event) {
// 暂时忽略 IE8-
if (window.G_vmlCanvasManager) {
return true;
}

event = event || window.event;
// 进入对象优先~
var target = event.toElement
|| event.relatedTarget
|| event.srcElement
|| event.target;

return target && target.className.match(config.elementClassName)
};

var domHandlers = {
/**
* 窗口大小改变响应函数
Expand All @@ -2792,6 +2810,10 @@ define(
* @param {Event} event
*/
click: function (event) {
if (! isZRenderElement(event)) {
return;
}

event = this._zrenderEventFixed(event);

// 分发config.EVENT.CLICK事件
Expand All @@ -2815,6 +2837,10 @@ define(
* @param {Event} event
*/
dblclick: function (event) {
if (! isZRenderElement(event)) {
return;
}

event = event || window.event;
event = this._zrenderEventFixed(event);

Expand All @@ -2840,6 +2866,10 @@ define(
* @param {Event} event
*/
mousewheel: function (event) {
if (! isZRenderElement(event)) {
return;
}

event = this._zrenderEventFixed(event);

// http://www.sitepoint.com/html5-javascript-mouse-wheel/
Expand Down Expand Up @@ -2891,6 +2921,10 @@ define(
* @param {Event} event
*/
mousemove: function (event) {
if (! isZRenderElement(event)) {
return;
}

if (this.painter.isLoading()) {
return;
}
Expand Down Expand Up @@ -2984,6 +3018,10 @@ define(
* @param {Event} event
*/
mouseout: function (event) {
if (! isZRenderElement(event)) {
return;
}

event = this._zrenderEventFixed(event);

var element = event.toElement || event.relatedTarget;
Expand Down Expand Up @@ -3020,6 +3058,10 @@ define(
* @param {Event} event
*/
mousedown: function (event) {
if (! isZRenderElement(event)) {
return;
}

// 重置 clickThreshold
this._clickThreshold = 0;

Expand All @@ -3046,6 +3088,10 @@ define(
* @param {Event} event
*/
mouseup: function (event) {
if (! isZRenderElement(event)) {
return;
}

event = this._zrenderEventFixed(event);
this.root.style.cursor = 'default';
this._isMouseDown = 0;
Expand All @@ -3063,6 +3109,10 @@ define(
* @param {Event} event
*/
touchstart: function (event) {
if (! isZRenderElement(event)) {
return;
}

// eventTool.stop(event);// 阻止浏览器默认事件,重要
event = this._zrenderEventFixed(event, true);
this._lastTouchMoment = new Date();
Expand All @@ -3078,6 +3128,10 @@ define(
* @param {Event} event
*/
touchmove: function (event) {
if (! isZRenderElement(event)) {
return;
}

event = this._zrenderEventFixed(event, true);
this._mousemoveHandler(event);
if (this._isDragging) {
Expand All @@ -3091,6 +3145,10 @@ define(
* @param {Event} event
*/
touchend: function (event) {
if (! isZRenderElement(event)) {
return;
}

// eventTool.stop(event);// 阻止浏览器默认事件,重要
event = this._zrenderEventFixed(event, true);
this._mouseupHandler(event);
Expand Down Expand Up @@ -7738,6 +7796,8 @@ define('zrender/Layer',['require','./mixin/Transformable','./tool/util','./confi
this.dom.style['-webkit-touch-callout'] = 'none';
this.dom.style['-webkit-tap-highlight-color'] = 'rgba(0,0,0,0)';

this.dom.className = config.elementClassName;

vmlCanvasManager && vmlCanvasManager.initElement(this.dom);

this.domBack = null;
Expand Down Expand Up @@ -8193,6 +8253,7 @@ define(
'-webkit-touch-callout:none;'
].join('');
this._bgDom.setAttribute('data-zr-dom-id', 'bg');
this._bgDom.className = config.elementClassName;

domRoot.appendChild(this._bgDom);
this._bgDom.onselectstart = returnFalse;
Expand Down Expand Up @@ -9308,22 +9369,22 @@ define(

el.updateTransform();

if (el.type == 'group') {

if (el.clipShape) {
// clipShape 的变换是基于 group 的变换
el.clipShape.parent = el;
el.clipShape.updateTransform();

// PENDING 效率影响
if (clipShapes) {
clipShapes = clipShapes.slice();
clipShapes.push(el.clipShape);
} else {
clipShapes = [el.clipShape];
}
if (el.clipShape) {
// clipShape 的变换是基于 group 的变换
el.clipShape.parent = el;
el.clipShape.updateTransform();

// PENDING 效率影响
if (clipShapes) {
clipShapes = clipShapes.slice();
clipShapes.push(el.clipShape);
} else {
clipShapes = [el.clipShape];
}
}

if (el.type == 'group') {

for (var i = 0; i < el._children.length; i++) {
var child = el._children[i];

Expand Down Expand Up @@ -10658,7 +10719,7 @@ define(
/**
* @type {string}
*/
zrender.version = '2.0.9';
zrender.version = '2.1.0';

/**
* 创建zrender实例
Expand Down
2 changes: 1 addition & 1 deletion build/zrender.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions doc/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@
<div class="container">
<h2>修改记录</h2>
<div class="row-fluid">
<div>
<h3>2.1.0<small>(2015-6-30)</small></h3>
<ul>
<li>Elements created by zrender have className 'zr-element'.</li>
</ul>
</div>
<div>
<h3>2.0.9<small>(2015-05-27)</small></h3>
<ul>
Expand Down
4 changes: 2 additions & 2 deletions doc/doc.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
<li><a href="example/slice.html">slice</a></li>
</ul>
</li>
<li class="active"><a href="doc.html">API &amp; Doc</a></li>
<li class="active"><a href="api/index.html">API &amp; Doc</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-download-alt icon-white"></i>Download <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="https://github.com/ecomfe/zrender/archive/2.0.9.zip">ZIP (2.0.9)</a></li>
<li><a href="https://github.com/ecomfe/zrender/archive/2.1.0.zip">ZIP (2.1.0)</a></li>
<li><a href="https://github.com/ecomfe/zrender/archive/master.zip">ZIP (Latest)</a></li>
</ul>
</li>
Expand Down
2 changes: 1 addition & 1 deletion doc/example/animation.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-download-alt icon-white"></i>Download <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="https://github.com/ecomfe/zrender/archive/2.0.9.zip">ZIP (2.0.9)</a></li>
<li><a href="https://github.com/ecomfe/zrender/archive/2.1.0.zip">ZIP (2.1.0)</a></li>
<li><a href="https://github.com/ecomfe/zrender/archive/master.zip">ZIP (Latest)</a></li>
</ul>
</li>
Expand Down
2 changes: 1 addition & 1 deletion doc/example/artist.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-download-alt icon-white"></i>Download <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="https://github.com/ecomfe/zrender/archive/2.0.9.zip">ZIP (2.0.9)</a></li>
<li><a href="https://github.com/ecomfe/zrender/archive/2.1.0.zip">ZIP (2.1.0)</a></li>
<li><a href="https://github.com/ecomfe/zrender/archive/master.zip">ZIP (Latest)</a></li>
</ul>
</li>
Expand Down
2 changes: 1 addition & 1 deletion doc/example/chart.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-download-alt icon-white"></i>Download <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="https://github.com/ecomfe/zrender/archive/2.0.9.zip">ZIP (2.0.9)</a></li>
<li><a href="https://github.com/ecomfe/zrender/archive/2.1.0.zip">ZIP (2.1.0)</a></li>
<li><a href="https://github.com/ecomfe/zrender/archive/master.zip">ZIP (Latest)</a></li>
</ul>
</li>
Expand Down
2 changes: 1 addition & 1 deletion doc/example/colorSeries.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-download-alt icon-white"></i>Download <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="https://github.com/ecomfe/zrender/archive/2.0.9.zip">ZIP (2.0.9)</a></li>
<li><a href="https://github.com/ecomfe/zrender/archive/2.1.0.zip">ZIP (2.1.0)</a></li>
<li><a href="https://github.com/ecomfe/zrender/archive/master.zip">ZIP (Latest)</a></li>
</ul>
</li>
Expand Down
2 changes: 1 addition & 1 deletion doc/example/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-download-alt icon-white"></i>Download <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="https://github.com/ecomfe/zrender/archive/2.0.9.zip">ZIP (2.0.9)</a></li>
<li><a href="https://github.com/ecomfe/zrender/archive/2.1.0.zip">ZIP (2.1.0)</a></li>
<li><a href="https://github.com/ecomfe/zrender/archive/master.zip">ZIP (Latest)</a></li>
</ul>
</li>
Expand Down
2 changes: 1 addition & 1 deletion doc/example/myShape.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-download-alt icon-white"></i>Download <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="https://github.com/ecomfe/zrender/archive/2.0.9.zip">ZIP (2.0.9)</a></li>
<li><a href="https://github.com/ecomfe/zrender/archive/2.1.0.zip">ZIP (2.1.0)</a></li>
<li><a href="https://github.com/ecomfe/zrender/archive/master.zip">ZIP (Latest)</a></li>
</ul>
</li>
Expand Down
2 changes: 1 addition & 1 deletion doc/example/slice.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-download-alt icon-white"></i>Download <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="https://github.com/ecomfe/zrender/archive/2.0.9.zip">ZIP (2.0.9)</a></li>
<li><a href="https://github.com/ecomfe/zrender/archive/2.1.0.zip">ZIP (2.1.0)</a></li>
<li><a href="https://github.com/ecomfe/zrender/archive/master.zip">ZIP (Latest)</a></li>
</ul>
</li>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zrender",
"version": "2.0.9",
"version": "2.1.0",
"maintainers": [
{ "name": "Kener", "email": "[email protected]" },
{ "name": "Pissang", "email": "[email protected]" },
Expand Down
2 changes: 1 addition & 1 deletion src/zrender.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ define(
/**
* @type {string}
*/
zrender.version = '2.0.9';
zrender.version = '2.1.0';

/**
* 创建zrender实例
Expand Down

0 comments on commit b519622

Please sign in to comment.