actionsheet unit test

This commit is contained in:
cookfront
2017-04-12 12:01:44 +08:00
parent b207efe729
commit 7c75f48eaa
12 changed files with 130 additions and 36 deletions
+8 -8
View File
@@ -1,10 +1,10 @@
import { EventEmitter, extend } from './utils'
import { EventEmitter, extend } from './utils';
const setElementsStyles = (elems, styles) => {
Array.prototype.forEach.call(elems, item => {
extend(item.style, styles)
})
}
extend(item.style, styles);
});
};
function Scroll(wrapElem, options) {
EventEmitter.apply(this, arguments);
@@ -33,14 +33,14 @@ extend(Scroll.prototype, {
},
update: function() {
const oldPages = this.pages
const oldPages = this.pages;
this.pages = this.wrapElem.querySelectorAll('.zan-swipe-item');
if (oldPages && oldPages.length === this.pages.length) {
const isSame = Array.prototype.every.call(this.pages, (elem, index) => {
return this.pages[index] === oldPages[index]
})
return this.pages[index] === oldPages[index];
});
if (isSame) {
return
return;
}
}
var defaultStyle = {