This iteration is expensive. repeated appends also call repeated refreshes
You can build the nodes individually, or pass a string to update the UI once.
var li_nodes = new Y.NodeList([]); Y.each(error_msgs, function(error_msg){ li_nodes.push( Y.Node.create('<li></li>').set('text', error_msg));
}); error_list.append(li_nodes);
Thank you for removing the ambiguous and tiny icons. "Ok" is a poor
action term that Launchpad and other UI guidelines avoid. "Save" or
"Change" are better generic terms. If we have a separate action/link to
remove/clear duplicate, then this action would be named "Save
Duplicate".
> @@ -82,12 +85,250 @@
> update_dupe_link.on('click', function(e) {
> // Only go ahead if we have received the form content by the
> // time the user clicks:
> - if (that.duplicate_form_overlay) {
> + if (that.duplicate_form) {
> e.halt();
> - that.duplicate_form_overlay.show();
> + that.duplicate_form.show();
> Y.DOM.byId('field.duplicateof').focus();
> }
> });
> + // We the due form overlay is hidden, we need to reset the form.
I think this is a good start. It is must better than what users are seeing now. I have a few remarks.
> === modified file 'lib/lp/ app/javascript/ formoverlay/ formoverlay. js' app/javascript/ formoverlay/ formoverlay. js 2012-06-26 00:15:11 +0000 app/javascript/ formoverlay/ formoverlay. js 2012-07-26 11:02:24 +0000 error_msgs) { isString( error_msgs) ) { create( '<p></p> ').set( 'text', error_msgs); </p><ul> </ul>') ; one('ul' ); error_msg) { appendChild( create( '<li></ li>').set( 'text', error_msg));
> --- lib/lp/
> +++ lib/lp/
> @@ -492,18 +492,19 @@
> * @method showError
> */
> showError: function(
> + var error_content;
> if (Y.Lang.
> - error_msgs = [error_msgs];
> + error_content = Y.Node.
> + } else {
> + error_content = Y.Node.create(
> + '<p>The following errors were encountered:
> + var error_list = error_content.
> + Y.each(error_msgs, function(
> + error_list.
> + Y.Node.
> + });
This iteration is expensive. repeated appends also call repeated refreshes
You can build the nodes individually, or pass a string to update the UI once.
var li_nodes = new Y.NodeList([]);
Y. each(error_ msgs, function( error_msg) {
li_nodes. push(
Y. Node.create( '<li></ li>').set( 'text', error_msg));
error_ list.append( li_nodes) ;
});
> === modified file 'lib/lp/ bugs/javascript /duplicates. js' bugs/javascript /duplicates. js 2012-07-25 00:31:04 +0000 bugs/javascript /duplicates. js 2012-07-26 11:02:24 +0000 actions. change" ' + actions. cancel" ' +
> --- lib/lp/
> +++ lib/lp/
> @@ -13,10 +13,10 @@
> // Overlay related vars.
> var submit_button_html =
> '<button type="submit" name="field.
> - 'value="Change" class="lazr-pos lazr-btn" >OK</button>';
> + '>OK</button>';
> var cancel_button_html =
> '<button type="button" name="field.
> - 'class="lazr-neg lazr-btn" >Cancel</button>';
> + '>Cancel</button>';
Thank you for removing the ambiguous and tiny icons. "Ok" is a poor
action term that Launchpad and other UI guidelines avoid. "Save" or
"Change" are better generic terms. If we have a separate action/link to
remove/clear duplicate, then this action would be named "Save
Duplicate".
> @@ -82,12 +85,250 @@ dupe_link. on('click' , function(e) { _form_overlay) { _form) { form_overlay. show(); form.show( ); 'field. duplicateof' ).focus( );
> update_
> // Only go ahead if we have received the form content by the
> // time the user clicks:
> - if (that.duplicate
> + if (that.duplicate
> e.halt();
> - that.duplicate_
> + that.duplicate_
> Y.DOM.byId(
> }
> });
> + // We the due form overlay is hidden, we need to reset the form.
Maybe s/We/When/;
> + // Template for rendering the bug details. template: function() {
> + _bug_details_
> + return [
> + '<div id="client-listing" style="max-width: 75em;">',
This looks too large. 60 is the max for English and that is what we
use else-where in Lp. Why does this need an exception?
+ // Template for the bug confirmation form. on_form_ template: function() { confirmation- node yui3-lazr- formoverlay- form" ',
+ _bug_confirmati
+ return [
+ '<div class="
+ 'style="margin-top: 5px;">',
This is an odd number that does not fit with proportions. Our fonts our
12px, we assume 6px or 3px.
+ '{{> bug_details}}', yui3-lazr- formoverlay- errors" ></div> ', extra-form- buttons" >', >Select bug</button>', >Search again</button>', cancel_ button" type="button" >Cancel< /button> ',
+ '<div class="
+ '<div class="
+ ' <button class="yes_button" type="button"
+ ' <button class="no_button" type="button"
+ ' <button class="
+ '</div>',
+ '</div>'].join('');
+ },
Lp button style is To capitalise each word in a button exceptfor prepositions or conjunctions.