Skip to content

Commit

Permalink
TAU release 1.0.18
Browse files Browse the repository at this point in the history
Dedicated platform: Tizen 4.0, Tizen 5.0

New features in 1.0.0:

- support for bezel-less devices
- extended widget control by touch
- new Date/Time pickers

Changes in version 1.0.18:
 - 814cdd7 Marquee: fix for wrong marquee position after reset

Signed-off-by: Tomasz Lukawski <t.lukawski@samsung.com>
  • Loading branch information
TomaszLukawskiSam committed Nov 28, 2019
1 parent 814cdd7 commit 57a9382
Show file tree
Hide file tree
Showing 8 changed files with 272 additions and 60 deletions.
2 changes: 1 addition & 1 deletion dist/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.17
1.0.18
138 changes: 122 additions & 16 deletions dist/mobile/js/tau.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var ns = window.tau = window.tau || {},
nsConfig = window.tauConfig = window.tauConfig || {};
nsConfig.rootNamespace = 'tau';
nsConfig.fileName = 'tau';
ns.version = '1.0.17';
ns.version = '1.0.18';
/*
* Copyright (c) 2015 Samsung Electronics Co., Ltd
*
Expand Down Expand Up @@ -865,6 +865,39 @@ ns.version = '1.0.17';
window.clearTimeout(currentFrame);
};

/**
* Remove animation callbacks added by requestAnimationFrame
* @method cancelAnimationFrames
* @static
* @member ns.util
* @param {*} animationId value for identify animation in queue
*/
util.cancelAnimationFrames = function (animationId) {
var found = 0,
len = waitingFrames.length,
i = 0;

if (animationId) {
// remove selected requests
while (len > 0 && found > -1) {
found = -1;
for (; i < len; i++) {
if (waitingFrames[i].animationId === animationId) {
found = i;
break;
}
}

if (found > -1) {
waitingFrames.splice(found, 1);
len--;
}
}
} else {
ns.warn("cancelAnimationFrames() require one parameter for request identify");
}
};

util._getCancelAnimationFrame = function () {
return (window.cancelAnimationFrame ||
window.webkitCancelAnimationFrame ||
Expand Down Expand Up @@ -6324,8 +6357,7 @@ ns.version = '1.0.17';
prototype._render = function (now) {
var self = this,
stateDOM = self._stateDOM,
element = self.element,
animation = self._animation;
element = self.element;

if (now === true) {
render(stateDOM, element, false);
Expand Down Expand Up @@ -32549,6 +32581,39 @@ function pathToRegexp (path, keys, options) {
window.clearTimeout(currentFrame);
};

/**
* Remove animation callbacks added by requestAnimationFrame
* @method cancelAnimationFrames
* @static
* @member ns.util
* @param {*} animationId value for identify animation in queue
*/
util.cancelAnimationFrames = function (animationId) {
var found = 0,
len = waitingFrames.length,
i = 0;

if (animationId) {
// remove selected requests
while (len > 0 && found > -1) {
found = -1;
for (; i < len; i++) {
if (waitingFrames[i].animationId === animationId) {
found = i;
break;
}
}

if (found > -1) {
waitingFrames.splice(found, 1);
len--;
}
}
} else {
ns.warn("cancelAnimationFrames() require one parameter for request identify");
}
};

util._getCancelAnimationFrame = function () {
return (window.cancelAnimationFrame ||
window.webkitCancelAnimationFrame ||
Expand Down Expand Up @@ -33331,6 +33396,8 @@ function pathToRegexp (path, keys, options) {
} else {
self._animationTimeout = self._calculateAnimate.bind(self, callback);
}
self._animationId = Math.random() + Date.now();
self._animationTimeout.animationId = self._animationId;
self._calculateAnimate(callback);
return self;
};
Expand All @@ -33346,7 +33413,9 @@ function pathToRegexp (path, keys, options) {
self._animate.chainIndex = 0;
// reset current animation config
self._animateConfig = null;
// clear timeout

ns.util.cancelAnimationFrames(self._animationId);
// clear timeout
self._animationTimeout = null;
return self;
};
Expand All @@ -33361,11 +33430,51 @@ function pathToRegexp (path, keys, options) {
}
};

/**
* Method resets startTime for each animations to current time
* @private
* @param {*} animateConfig
*/
function resetStartTimeForAnimateConfig(animateConfig) {
var i,
len;

if (animateConfig) {
len = animateConfig.length;
for (i = 0; i < len; i++) {
animateConfig[i].startTime = Date.now();
}
}
}

/**
* Reset animations to initial position
*/
prototype.reset = function () {
var self = this,
restart = self.active;

if (restart) {
self.stop();
}

self._initAnimate();
resetStartTimeForAnimateConfig(self._animateConfig);
self._pausedTimeDiff = 0;
self._animate.chainIndex = 0;

self._calculateAnimate();

if (restart) {
self.start();
}
}

function calculateOption(option, time) {
var timeDiff,
current = null;

if (option && option.startTime < time) {
if (option && option.startTime <= time) {
// if option is not delayed
timeDiff = time - option.startTime;

Expand Down Expand Up @@ -33452,7 +33561,7 @@ function pathToRegexp (path, keys, options) {
self._tickFunction(self._object);
}
if (notFinishedAnimationsCount) {
// setting next loop state
// setting next loop state
if (self._animationTimeout) {
requestAnimationFrame(self._animationTimeout);
}
Expand Down Expand Up @@ -33817,6 +33926,8 @@ function pathToRegexp (path, keys, options) {
prototype._build = function (element) {
var marqueeInnerElement = element.querySelector("." + classes.MARQUEE_CONTENT);

element.classList.add(CLASSES_PREFIX);

if (!marqueeInnerElement) {
marqueeInnerElement = document.createElement("div");

Expand Down Expand Up @@ -34045,7 +34156,6 @@ function pathToRegexp (path, keys, options) {
self._animation.stop();
self._animation.destroy();
self._animation = null;
self.element.classList.remove(classes.MARQUEE_GRADIENT);
self.element.style.webkitMaskImage = "";

marqueeInnerElement = self.element.querySelector("." + classes.MARQUEE_CONTENT);
Expand Down Expand Up @@ -34097,10 +34207,6 @@ function pathToRegexp (path, keys, options) {
* @member ns.widget.core.Marquee
*/
prototype.stop = function () {
var self = this,
animation = self._animation;

animation.pause();
this.option("animation", "stopped");
};

Expand All @@ -34122,12 +34228,12 @@ function pathToRegexp (path, keys, options) {
*/
prototype.reset = function () {
var self = this,
stateDOM = self._stateDOM;
animation = self._animation;

this.option("animation", "stopped");
stateDOM.style.webkitMaskImage = (this.options.ellipsisEffect === "none") ? "" : GRADIENTS.RIGHT;
stateDOM.children[0].style.webkitTransform = "translateX(0)";
self._render(true);
animation.reset();

self.element.style.webkitMaskImage = (self.options.ellipsisEffect === "none") ?
"" : GRADIENTS.RIGHT;
};

Marquee.prototype = prototype;
Expand Down
24 changes: 12 additions & 12 deletions dist/mobile/js/tau.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/mobile/js/tau.support-2.3.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var ns = window.tau = window.tau || {},
nsConfig = window.tauConfig = window.tauConfig || {};
nsConfig.rootNamespace = 'tau';
nsConfig.fileName = 'tau';
ns.version = '1.0.17';
ns.version = '1.0.18';
/*global window, ns, define */
/*
* Copyright (c) 2015 Samsung Electronics Co., Ltd
Expand Down
2 changes: 1 addition & 1 deletion dist/mobile/js/tau.support-2.3.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 57a9382

Please sign in to comment.