Author: jmorliaguet Date: Sat Feb 25 13:44:27 2006 New Revision: 2456 Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js Log:
- simplifications: the scheduler doesn't need to know about the node on which the effect is applied. Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js ============================================================================== --- cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js (original) +++ cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js Sat Feb 25 13:44:27 2006 @@ -805,12 +805,11 @@ CPSSkins.Scheduler = Class.create(); CPSSkins.Scheduler.prototype = { - initialize: function(element, options) { - this.element = $(element); - this.action = options.action || function(value) {}; + initialize: function(options) { this.delay = options.delay || 0; - this.onComplete = options.onComplete || function() {}; this.duration = options.duration || 300; + this.action = options.action || function(value) {}; + this.onComplete = options.onComplete || function() {}; this.started = false; this.start(); @@ -848,11 +847,9 @@ show: function(node, options) { var delay = options.delay; if (delay) { - return new CPSSkins.Scheduler(node, { + return new CPSSkins.Scheduler({ delay: delay, - onComplete: function() { - Element.show(node); - } + onComplete: function() { Element.show(node); } }); } else { Element.show(node); @@ -862,11 +859,9 @@ hide: function(node, options) { var delay = options.delay; if (delay) { - return new CPSSkins.Scheduler(node, { + return new CPSSkins.Scheduler({ delay: delay, - onComplete: function() { - Element.hide(node); - } + onComplete: function() { Element.hide(node); } }); } else { Element.hide(node); @@ -876,7 +871,7 @@ fadein: function(node, options) { var setOpacity = CPSSkins.Canvas.setOpacity; setOpacity(node, 0); - return new CPSSkins.Scheduler(node, { + return new CPSSkins.Scheduler({ delay: options.delay, duration: options.duration, action: function(value) { setOpacity(node, value) }, @@ -891,7 +886,7 @@ action: function(value) { setOpacity(node, 1-value) }, onComplete: function() { Element.hide(node) } }); - return new CPSSkins.Scheduler(node, options); + return new CPSSkins.Scheduler(options); }, blinddown: function(node, options) { @@ -906,7 +901,7 @@ Element.undoClipping(node); } }); - return new CPSSkins.Scheduler(node, options); + return new CPSSkins.Scheduler(options); }, blindup: function(node, options) { @@ -918,7 +913,7 @@ }, onComplete: function() { Element.setStyle(node, {height: '0px'}); } }); - return new CPSSkins.Scheduler(node, options); + return new CPSSkins.Scheduler(options); } } -- http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins