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

Proposed by Deryck Hodge
Status: Merged
Approved by: Deryck Hodge
Approved revision: 216
Merged at revision: 214
Proposed branch: lp:~deryck/lazr-js/make-effects-duration-monkeypatchable
Merge into: lp:lazr-js
Diff against target: 54 lines (+7/-7)
2 files modified
setup.py (+1/-1)
src-js/lazrjs/effects/effects.js (+6/-6)
To merge this branch: bzr merge lp:~deryck/lazr-js/make-effects-duration-monkeypatchable
Reviewer Review Type Date Requested Status
Deryck Hodge (community) code Approve
Review via email: mp+65522@code.launchpad.net

Commit message

Add slide_effect_defaults to the lazr.effects namespace, making the defaults public.

Description of the change

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.

To post a comment you must log in.
Revision history for this message
Deryck Hodge (deryck) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'setup.py'
--- setup.py 2011-01-20 22:34:44 +0000
+++ setup.py 2011-06-22 15:49:33 +0000
@@ -10,7 +10,7 @@
10 from setuptools import setup10 from setuptools import setup
1111
1212
13__version__ = '1.6DEV'13__version__ = '1.7DEV'
1414
15setup(15setup(
16 name='lazr-js',16 name='lazr-js',
1717
=== 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:33 +0000
@@ -24,13 +24,13 @@
24 * @namespace lazr.effects24 * @namespace lazr.effects
25 */25 */
2626
27Y.namespace('lazr.effects');27var namespace = Y.namespace('lazr.effects');
2828
29var OPENED = 'lazr-opened';29var OPENED = 'lazr-opened';
30var CLOSED = 'lazr-closed';30var CLOSED = 'lazr-closed';
3131
32/* Defaults for the slide_in and slide_out effects. */32/* Defaults for the slide_in and slide_out effects. */
33var slide_effect_defaults = {33namespace.slide_effect_defaults = {
34 easing: Y.Easing.easeOut,34 easing: Y.Easing.easeOut,
35 duration: 0.435 duration: 0.4
36};36};
@@ -56,8 +56,8 @@
56 * These will override the default parameters of the same name.56 * These will override the default parameters of the same name.
57 * @return {Y.Anim} A new animation instance.57 * @return {Y.Anim} A new animation instance.
58 */58 */
59Y.lazr.effects.slide_out = function(node, user_cfg) {59namespace.slide_out = function(node, user_cfg) {
60 var cfg = Y.merge(slide_effect_defaults, user_cfg);60 var cfg = Y.merge(namespace.slide_effect_defaults, user_cfg);
6161
62 if (typeof cfg.node == 'undefined') {62 if (typeof cfg.node == 'undefined') {
63 cfg.node = node;63 cfg.node = node;
@@ -120,8 +120,8 @@
120 * These will override the default parameters of the same name.120 * These will override the default parameters of the same name.
121 * @return {Y.Anim} A new animation instance.121 * @return {Y.Anim} A new animation instance.
122 */122 */
123Y.lazr.effects.slide_in = function(node, user_cfg) {123namespace.slide_in = function(node, user_cfg) {
124 var cfg = Y.merge(slide_effect_defaults, user_cfg);124 var cfg = Y.merge(namespace.slide_effect_defaults, user_cfg);
125125
126 if (typeof cfg.node == 'undefined') {126 if (typeof cfg.node == 'undefined') {
127 cfg.node = node;127 cfg.node = node;

Subscribers

People subscribed via source and target branches