This looks good to land, but I ask that you refrain until YUI unittests run automatically.
> === renamed file 'lib/canonical/launchpad/javascript/registry/productseries-setbranch.js' => 'lib/canonical/launchpad/javascript/code/productseries-setbranch.js' > --- lib/canonical/launchpad/javascript/registry/productseries-setbranch.js 2010-03-15 21:13:23 +0000 > +++ lib/canonical/launchpad/javascript/code/productseries-setbranch.js 2010-03-19 13:35:15 +0000 ... > + module.setup = function() { > + Y.all('input[name=field.rcs_type]').each(function(field) { > + field.on('click', module.onclick_rcs_type);}); > + Y.all('input[name=field.branch_type]').each(function(field) { > + field.on('click', module.onclick_branch_type);});
I think these could use the ListNode.on() method to make the code a little easier to read.
Y.all('input[name=field.rcs_type]').on( 'click', module.onclick_rcs_type); Y.all('input[name=field.branch_type]').on( 'click', module.onclick_branch_type); ...
> === renamed file 'lib/canonical/launchpad/javascript/registry/tests/test_productseries_setbranch.js' => 'lib/canonical/launchpad/javascript/code/tests/test_productseries_setbranch.js' > --- lib/canonical/launchpad/javascript/registry/tests/test_productseries_setbranch.js 2010-03-15 21:13:23 +0000 > +++ lib/canonical/launchpad/javascript/code/tests/test_productseries_setbranch.js 2010-03-19 14:29:27 +0000 ... > @@ -48,31 +50,50 @@ > > tearDown: function() { > delete this.tbody; > - }, > + }, > > test_handlers_connected: function() { > - Y.Assert.areEqual('onclickBranchType()', > - this.link_lp_bzr.getAttribute('onclick'), > - 'branch type onclick handler not correct'); > - Y.Assert.areEqual('onclickBranchType()', > - this.create_new.getAttribute('onclick'), > - 'branch type onclick handler not correct'); > - Y.Assert.areEqual('onclickBranchType()', > - this.import_external.getAttribute('onclick'), > - 'branch type onclick handler not correct'); > - > + // Manually invoke the setup function to ensure the handlers are set.+ module.setup();
Wrap the code at 78 characters. ...
@@ -202,7 +234,8 @@ var console = new Y.Console({newestOnTop: false}); console.render('#log');
- Y.on('domready', function() { + // Start the test runner on Y.after to ensure all setup has had a chance to complete.
« Back to merge proposal
This looks good to land, but I ask that you refrain until YUI unittests run automatically.
> === renamed file 'lib/canonical/ launchpad/ javascript/ registry/ productseries- setbranch. js' => 'lib/canonical/ launchpad/ javascript/ code/productser ies-setbranch. js' launchpad/ javascript/ registry/ productseries- setbranch. js 2010-03-15 21:13:23 +0000 launchpad/ javascript/ code/productser ies-setbranch. js 2010-03-19 13:35:15 +0000 input[name= field.rcs_ type]') .each(function( field) { onclick_ rcs_type) ;}); input[name= field.branch_ type]') .each(function( field) { onclick_ branch_ type);} );
> --- lib/canonical/
> +++ lib/canonical/
...
> + module.setup = function() {
> + Y.all('
> + field.on('click', module.
> + Y.all('
> + field.on('click', module.
I think these could use the ListNode.on() method to make the code a little
easier to read.
...
> === renamed file 'lib/canonical/ launchpad/ javascript/ registry/ tests/test_ productseries_ setbranch. js' => 'lib/canonical/ launchpad/ javascript/ code/tests/ test_productser ies_setbranch. js' launchpad/ javascript/ registry/ tests/test_ productseries_ setbranch. js 2010-03-15 21:13:23 +0000 launchpad/ javascript/ code/tests/ test_productser ies_setbranch. js 2010-03-19 14:29:27 +0000 connected: function() { areEqual( 'onclickBranchT ype()', lp_bzr. getAttribute( 'onclick' ), areEqual( 'onclickBranchT ype()', new.getAttribut e('onclick' ), areEqual( 'onclickBranchT ype()', external. getAttribute( 'onclick' ),
> --- lib/canonical/
> +++ lib/canonical/
...
> @@ -48,31 +50,50 @@
>
> tearDown: function() {
> delete this.tbody;
> - },
> + },
>
> test_handlers_
> - Y.Assert.
> - this.link_
> - 'branch type onclick handler not correct');
> - Y.Assert.
> - this.create_
> - 'branch type onclick handler not correct');
> - Y.Assert.
> - this.import_
> - 'branch type onclick handler not correct');
> -
> + // Manually invoke the setup function to ensure the handlers are set.+ module.setup();
Wrap the code at 78 characters.
...
@@ -202,7 +234,8 @@ {newestOnTop: false}); render( '#log') ;
var console = new Y.Console(
console.
- Y.on('domready', function() {
+ // Start the test runner on Y.after to ensure all setup has had a chance to complete.
Wrap the code at 78 characters.
...