Skip to content

Commit

Permalink
编译至mui v 2.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hbcui1984 committed Nov 5, 2015
1 parent 228a4f4 commit 56cff1f
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 23 deletions.
2 changes: 1 addition & 1 deletion dist/css/mui.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* =====================================================
* Mui v2.5.0 (http://dev.dcloud.net.cn/mui)
* Mui v2.6.0 (http://dev.dcloud.net.cn/mui)
* =====================================================
*/

Expand Down
2 changes: 1 addition & 1 deletion dist/css/mui.min.css

Large diffs are not rendered by default.

25 changes: 21 additions & 4 deletions dist/js/mui.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* =====================================================
* Mui v2.5.0 (http://dev.dcloud.net.cn/mui)
* Mui v2.6.0 (http://dev.dcloud.net.cn/mui)
* =====================================================
*/
/**
Expand Down Expand Up @@ -2396,6 +2396,7 @@ Function.prototype.bind = Function.prototype.bind || function(to) {
var action = $.targets.action;
if (action && action.classList.contains('mui-action-back')) {
$.back();
$.targets.action = false;
}
});
window.addEventListener('swiperight', function(e) {
Expand Down Expand Up @@ -2746,7 +2747,8 @@ Function.prototype.bind = Function.prototype.bind || function(to) {
xhr.onreadystatechange = $.noop;
clearTimeout(abortTimeout);
var result, error = false;
if ((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304 || (xhr.status === 0 && protocol === 'file:')) {
var isLocal = protocol === 'file:';
if ((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304 || (xhr.status === 0 && isLocal && xhr.responseText)) {
dataType = dataType || mimeToDataType(settings.mimeType || xhr.getResponseHeader('content-type'));
result = xhr.responseText;
try {
Expand All @@ -2768,7 +2770,13 @@ Function.prototype.bind = Function.prototype.bind || function(to) {
ajaxSuccess(result, xhr, settings);
}
} else {
ajaxError(xhr.statusText || null, xhr.status ? 'error' : 'abort', xhr, settings);
var status = xhr.status ? 'error' : 'abort';
var statusText = xhr.statusText || null;
if (isLocal) {
status = 'error';
statusText = '404';
}
ajaxError(statusText, status, xhr, settings);
}
}
};
Expand Down Expand Up @@ -3425,6 +3433,7 @@ Function.prototype.bind = Function.prototype.bind || function(to) {
this._end(e);
break;
case 'webkitTransitionEnd':
this.transitionTimer && this.transitionTimer.cancel();
this._transitionEnd(e);
break;
case 'scrollend':
Expand Down Expand Up @@ -3673,6 +3682,12 @@ Function.prototype.bind = Function.prototype.bind || function(to) {
this.indicators[i].transitionTime(time);
}
}
if (time) { //自定义timer,保证webkitTransitionEnd始终触发
this.transitionTimer && this.transitionTimer.cancel();
this.transitionTimer = $.later(function() {
$.trigger(this.scroller, 'webkitTransitionEnd');
}, time + 100, this);
}
},
_transitionTimingFunction: function(easing) {
this.scrollerStyle['webkitTransitionTimingFunction'] = easing;
Expand Down Expand Up @@ -3869,7 +3884,9 @@ Function.prototype.bind = Function.prototype.bind || function(to) {
},
scrollTo: function(x, y, time, easing) {
var easing = easing || ease.circular;
this.isInTransition = time > 0 && (this.lastX != x || this.lastY != y);
// this.isInTransition = time > 0 && (this.lastX != x || this.lastY != y);
//暂不严格判断x,y,否则会导致部分版本上不正常触发轮播
this.isInTransition = time > 0;
if (this.isInTransition) {
this._clearRequestAnimationFrame();
this._transitionTimingFunction(easing.style);
Expand Down
10 changes: 5 additions & 5 deletions dist/js/mui.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/hello-mui/css/mui.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* =====================================================
* Mui v2.5.0 (http://dev.dcloud.net.cn/mui)
* Mui v2.6.0 (http://dev.dcloud.net.cn/mui)
* =====================================================
*/

Expand Down
2 changes: 1 addition & 1 deletion examples/hello-mui/css/mui.min.css

Large diffs are not rendered by default.

25 changes: 21 additions & 4 deletions examples/hello-mui/js/mui.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* =====================================================
* Mui v2.5.0 (http://dev.dcloud.net.cn/mui)
* Mui v2.6.0 (http://dev.dcloud.net.cn/mui)
* =====================================================
*/
/**
Expand Down Expand Up @@ -2396,6 +2396,7 @@ Function.prototype.bind = Function.prototype.bind || function(to) {
var action = $.targets.action;
if (action && action.classList.contains('mui-action-back')) {
$.back();
$.targets.action = false;
}
});
window.addEventListener('swiperight', function(e) {
Expand Down Expand Up @@ -2746,7 +2747,8 @@ Function.prototype.bind = Function.prototype.bind || function(to) {
xhr.onreadystatechange = $.noop;
clearTimeout(abortTimeout);
var result, error = false;
if ((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304 || (xhr.status === 0 && protocol === 'file:')) {
var isLocal = protocol === 'file:';
if ((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304 || (xhr.status === 0 && isLocal && xhr.responseText)) {
dataType = dataType || mimeToDataType(settings.mimeType || xhr.getResponseHeader('content-type'));
result = xhr.responseText;
try {
Expand All @@ -2768,7 +2770,13 @@ Function.prototype.bind = Function.prototype.bind || function(to) {
ajaxSuccess(result, xhr, settings);
}
} else {
ajaxError(xhr.statusText || null, xhr.status ? 'error' : 'abort', xhr, settings);
var status = xhr.status ? 'error' : 'abort';
var statusText = xhr.statusText || null;
if (isLocal) {
status = 'error';
statusText = '404';
}
ajaxError(statusText, status, xhr, settings);
}
}
};
Expand Down Expand Up @@ -3425,6 +3433,7 @@ Function.prototype.bind = Function.prototype.bind || function(to) {
this._end(e);
break;
case 'webkitTransitionEnd':
this.transitionTimer && this.transitionTimer.cancel();
this._transitionEnd(e);
break;
case 'scrollend':
Expand Down Expand Up @@ -3673,6 +3682,12 @@ Function.prototype.bind = Function.prototype.bind || function(to) {
this.indicators[i].transitionTime(time);
}
}
if (time) { //自定义timer,保证webkitTransitionEnd始终触发
this.transitionTimer && this.transitionTimer.cancel();
this.transitionTimer = $.later(function() {
$.trigger(this.scroller, 'webkitTransitionEnd');
}, time + 100, this);
}
},
_transitionTimingFunction: function(easing) {
this.scrollerStyle['webkitTransitionTimingFunction'] = easing;
Expand Down Expand Up @@ -3869,7 +3884,9 @@ Function.prototype.bind = Function.prototype.bind || function(to) {
},
scrollTo: function(x, y, time, easing) {
var easing = easing || ease.circular;
this.isInTransition = time > 0 && (this.lastX != x || this.lastY != y);
// this.isInTransition = time > 0 && (this.lastX != x || this.lastY != y);
//暂不严格判断x,y,否则会导致部分版本上不正常触发轮播
this.isInTransition = time > 0;
if (this.isInTransition) {
this._clearRequestAnimationFrame();
this._transitionTimingFunction(easing.style);
Expand Down
10 changes: 5 additions & 5 deletions examples/hello-mui/js/mui.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mui",
"description": "Build mobile apps with simple HTML, CSS, and JS components.",
"version": "2.5.0",
"version": "2.6.0",
"keywords": [
"css",
"fonts",
Expand Down

0 comments on commit 56cff1f

Please sign in to comment.