Modify ↓
Opened 12 years ago
Closed 12 years ago
#10496 closed defect (fixed)
js bug in adding status columns
Reported by: | Owned by: | Jun Omae | |
---|---|---|---|
Priority: | normal | Component: | TracWorkflowAdminPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 1.0 |
Description
I was wondering why the limit on the number of statuses was so low when I spotted that it was probably a bug due to the differences in the way that javascript deals with +
and -
operators with strings.
This appears to be a possible solution:
-
tracworkflowadmin/htdocs/scripts/main.js
657 657 var colspan = $('#status-header-bar').attr('colspan'); 658 658 var statusName = $('#new-status-input-dialog input').val(); 659 659 if (!statusName) return false; 660 $('#status-header-bar').attr('colspan', colspan+ 1);660 $('#status-header-bar').attr('colspan', parseInt(colspan) + 1); 661 661 var el = $($('#status-editor-1 th')[0]).clone(true); 662 662 $('input', el).val(statusName); 663 663 $('span:first', el).text(statusName);
Attachments (0)
Change History (3)
comment:1 Changed 12 years ago by
Status: | new → assigned |
---|
comment:2 Changed 12 years ago by
Trac Release: | 0.12 → 1.0 |
---|
Note: See
TracTickets for help on using
tickets.
I just confirmed. You're right.
$(selector).attr('colspan')
returns a number on Trac 0.12.x with jQuery 1.4.x. However, it returns a string on Trac 1.0 with jQuery 1.7.2.I'll apply the following patch later. Thanks!
tracworkflowadmin/htdocs/scripts/main.js