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
1=== modified file 'setup.py'
2--- setup.py 2011-01-20 22:34:44 +0000
3+++ setup.py 2011-06-22 15:49:33 +0000
4@@ -10,7 +10,7 @@
5 from setuptools import setup
6
7
8-__version__ = '1.6DEV'
9+__version__ = '1.7DEV'
10
11 setup(
12 name='lazr-js',
13
14=== modified file 'src-js/lazrjs/effects/effects.js'
15--- src-js/lazrjs/effects/effects.js 2011-01-14 14:52:37 +0000
16+++ src-js/lazrjs/effects/effects.js 2011-06-22 15:49:33 +0000
17@@ -24,13 +24,13 @@
18 * @namespace lazr.effects
19 */
20
21-Y.namespace('lazr.effects');
22+var namespace = Y.namespace('lazr.effects');
23
24 var OPENED = 'lazr-opened';
25 var CLOSED = 'lazr-closed';
26
27 /* Defaults for the slide_in and slide_out effects. */
28-var slide_effect_defaults = {
29+namespace.slide_effect_defaults = {
30 easing: Y.Easing.easeOut,
31 duration: 0.4
32 };
33@@ -56,8 +56,8 @@
34 * These will override the default parameters of the same name.
35 * @return {Y.Anim} A new animation instance.
36 */
37-Y.lazr.effects.slide_out = function(node, user_cfg) {
38- var cfg = Y.merge(slide_effect_defaults, user_cfg);
39+namespace.slide_out = function(node, user_cfg) {
40+ var cfg = Y.merge(namespace.slide_effect_defaults, user_cfg);
41
42 if (typeof cfg.node == 'undefined') {
43 cfg.node = node;
44@@ -120,8 +120,8 @@
45 * These will override the default parameters of the same name.
46 * @return {Y.Anim} A new animation instance.
47 */
48-Y.lazr.effects.slide_in = function(node, user_cfg) {
49- var cfg = Y.merge(slide_effect_defaults, user_cfg);
50+namespace.slide_in = function(node, user_cfg) {
51+ var cfg = Y.merge(namespace.slide_effect_defaults, user_cfg);
52
53 if (typeof cfg.node == 'undefined') {
54 cfg.node = node;

Subscribers

People subscribed via source and target branches