From 58f3061b66eb61056a93d08172af8e323ec25187 Mon Sep 17 00:00:00 2001 From: Ezequiel Bergamaschi Date: Tue, 13 May 2014 01:04:42 -0300 Subject: [PATCH] FadeEffect not working but hide and show correctly --- .../src/main/javascript/util/FadeEffect.js | 29 +++++-------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/mindplot/src/main/javascript/util/FadeEffect.js b/mindplot/src/main/javascript/util/FadeEffect.js index b17370aa..4a158479 100644 --- a/mindplot/src/main/javascript/util/FadeEffect.js +++ b/mindplot/src/main/javascript/util/FadeEffect.js @@ -16,36 +16,23 @@ * limitations under the License. */ +//FIXME: this Class should be reimplemented mindplot.util.FadeEffect = new Class({ -// Extends: Fx, + Extends: mindplot.Events, initialize: function(elements, isVisible) { - console.error("Re-impl required ...."); - this.parent({duration:3000,frames:15,transition:'linear'}); this._isVisible = isVisible; this._element = elements; - - - this.addEvent('complete', function() { - _.each(this._element, function(elem) { - if(elem){ - elem.setVisibility(isVisible); - } - }); - }); - }, start: function(){ - this.parent(this._isVisible ? 0 : 1, this._isVisible ? 1 : 0); - }, - - set: function(now) { + var visible = this._isVisible; _.each(this._element, function(elem) { - if(elem){ - elem.setOpacity(now); - } + if(elem){ + elem.setVisibility(visible); + } }); - return this; + this._isVisible = !visible; + this.fireEvent('complete'); } });