← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~deryck/lazr-js/make-effects-duration-monkeypatchable into lp:lazr-js

 

Deryck Hodge has proposed merging lp:~deryck/lazr-js/make-effects-duration-monkeypatchable into lp:lazr-js.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~deryck/lazr-js/make-effects-duration-monkeypatchable/+merge/65522

This hooks up slide_effect_defaults to the effects namespace, so the default duration can be monkey patched in lp tests.  This allows for speeding up tests.

I will self-review this since it's a simple change and there are only a handful of us doing lazr-js work now anyway.
-- 
https://code.launchpad.net/~deryck/lazr-js/make-effects-duration-monkeypatchable/+merge/65522
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~deryck/lazr-js/make-effects-duration-monkeypatchable into lp:lazr-js.
=== modified file 'setup.py'
--- setup.py	2011-01-20 22:34:44 +0000
+++ setup.py	2011-06-22 15:49:27 +0000
@@ -10,7 +10,7 @@
     from setuptools import setup
 
 
-__version__ = '1.6DEV'
+__version__ = '1.7DEV'
 
 setup(
     name='lazr-js',

=== modified file 'src-js/lazrjs/effects/effects.js'
--- src-js/lazrjs/effects/effects.js	2011-01-14 14:52:37 +0000
+++ src-js/lazrjs/effects/effects.js	2011-06-22 15:49:27 +0000
@@ -24,13 +24,13 @@
  * @namespace lazr.effects
  */
 
-Y.namespace('lazr.effects');
+var namespace = Y.namespace('lazr.effects');
 
 var OPENED = 'lazr-opened';
 var CLOSED = 'lazr-closed';
 
 /* Defaults for the slide_in and slide_out effects. */
-var slide_effect_defaults = {
+namespace.slide_effect_defaults = {
     easing: Y.Easing.easeOut,
     duration: 0.4
 };
@@ -56,8 +56,8 @@
  *     These will override the default parameters of the same name.
  * @return {Y.Anim} A new animation instance.
  */
-Y.lazr.effects.slide_out = function(node, user_cfg) {
-    var cfg = Y.merge(slide_effect_defaults, user_cfg);
+namespace.slide_out = function(node, user_cfg) {
+    var cfg = Y.merge(namespace.slide_effect_defaults, user_cfg);
 
     if (typeof cfg.node == 'undefined') {
         cfg.node = node;
@@ -120,8 +120,8 @@
  *     These will override the default parameters of the same name.
  * @return {Y.Anim} A new animation instance.
  */
-Y.lazr.effects.slide_in = function(node, user_cfg) {
-    var cfg = Y.merge(slide_effect_defaults, user_cfg);
+namespace.slide_in = function(node, user_cfg) {
+    var cfg = Y.merge(namespace.slide_effect_defaults, user_cfg);
 
     if (typeof cfg.node == 'undefined') {
         cfg.node = node;


Follow ups