~launchpad-pqm/lazr-js/toolchain

« back to all changes in this revision

Viewing changes to src-js/lazrjs/activator/activator.js

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-03-16 00:14:15 UTC
  • mfrom: (204.2.4 activator-flash-node)
  • Revision ID: launchpad@pqm.canonical.com-20110316001415-jnlqxpl4ix5n10av
[r=deryck][bug=735832] Add support to the Activator for a custom
        animation node to be specified for success, failure or cancellation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
156
156
        }
157
157
        this._setStatusClass(C_SUCCESS);
158
158
        this._renderMessage('Message', message_node);
159
 
        var anim = Y.lazr.anim.green_flash({node: this.get('contentBox')});
 
159
        var anim = Y.lazr.anim.green_flash({node: this.animation_node});
160
160
        anim.run();
161
161
    },
162
162
 
170
170
    renderFailure: function(message_node) {
171
171
        this._renderMessage('Error', message_node);
172
172
        this._setStatusClass(C_FAILURE);
173
 
        var anim = Y.lazr.anim.red_flash({node: this.get('contentBox')});
 
173
        var anim = Y.lazr.anim.red_flash({node: this.animation_node});
174
174
        anim.run();
175
175
    },
176
176
 
184
184
    renderCancellation: function(message_node) {
185
185
        this._renderMessage('Message', message_node);
186
186
        this._setStatusClass(C_CANCEL);
187
 
        var anim = Y.lazr.anim.red_flash({node: this.get('contentBox')});
 
187
        var anim = Y.lazr.anim.red_flash({node: this.animation_node});
188
188
        anim.run();
189
189
    },
190
190
 
231
231
            throw new Error("Can't find element with CSS class " +
232
232
                C_ACT + ".");
233
233
        }
 
234
        this.animation_node = cfg.animationNode;
 
235
        if (this.animation_node === undefined) {
 
236
            this.animation_node = this.get('contentBox');
 
237
        }
234
238
    },
235
239
 
236
240
    /**