update tabs
This commit is contained in:
parent
146daaccd0
commit
f2e329c22d
11 changed files with 84 additions and 81 deletions
|
@ -3,7 +3,6 @@ define(['browser'], function (browser) {
|
|||
var allPages = document.querySelectorAll('.mainAnimatedPage');
|
||||
var currentUrls = [];
|
||||
var pageContainerCount = allPages.length;
|
||||
var animationDuration = 500;
|
||||
var allowAnimation = true;
|
||||
var selectedPageIndex = -1;
|
||||
|
||||
|
@ -154,7 +153,7 @@ define(['browser'], function (browser) {
|
|||
function fade(newAnimatedPage, oldAnimatedPage, transition, isBack) {
|
||||
|
||||
var timings = {
|
||||
duration: animationDuration,
|
||||
duration: 200,
|
||||
iterations: 1,
|
||||
easing: 'ease-out',
|
||||
fill: 'both'
|
||||
|
@ -210,16 +209,6 @@ define(['browser'], function (browser) {
|
|||
onBeforeChange = fn;
|
||||
}
|
||||
|
||||
function sendResolve(resolve, view) {
|
||||
|
||||
// Don't report completion until the animation has finished, otherwise rendering may not perform well
|
||||
setTimeout(function () {
|
||||
|
||||
resolve(view);
|
||||
|
||||
}, animationDuration);
|
||||
}
|
||||
|
||||
function getSelectedIndex(allPages) {
|
||||
|
||||
return selectedPageIndex;
|
||||
|
@ -275,31 +264,14 @@ define(['browser'], function (browser) {
|
|||
currentUrls = [];
|
||||
}
|
||||
|
||||
function parentWithClass(elem, className) {
|
||||
|
||||
while (!elem.classList || !elem.classList.contains(className)) {
|
||||
elem = elem.parentNode;
|
||||
|
||||
if (!elem) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return elem;
|
||||
}
|
||||
|
||||
function init(isAnimationAllowed) {
|
||||
|
||||
if (allowAnimation && enableAnimation() && !browser.animate) {
|
||||
require(['webAnimations']);
|
||||
}
|
||||
if (enableAnimation() && !browser.animate) {
|
||||
require(['webAnimations']);
|
||||
}
|
||||
|
||||
return {
|
||||
loadView: loadView,
|
||||
tryRestoreView: tryRestoreView,
|
||||
reset: reset,
|
||||
setOnBeforeChange: setOnBeforeChange,
|
||||
init: init
|
||||
setOnBeforeChange: setOnBeforeChange
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue