Edgewall Software

Changes between Version 3 and Version 4 of Ticket #13298


Ignore:
Timestamp:
May 21, 2020, 6:28:28 PM (4 years ago)
Author:
Ryan J Ollos
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #13298 – Description

    v3 v4  
    77The problem is due to two changes:
    88* In r13452 the workflow controls were added to the new ticket page. We added the //create and assign// action, which includes a select box for assigning the owner.
    9 * In r13707 the `ticket_workflow` template was added and the associated !JavaScript was moved into this template. !The JavaScript disables workflow inputs associated with actions that are not selected, such as the //create and assign// assign-to field. Since jQuery ready handlers executed in the order they are added, this JavaScript executes after autoSubmit initializes.
     9* In r13707 the `ticket_workflow.html` template was added and the associated !JavaScript was moved into this template. The !JavaScript disables workflow inputs associated with actions that are not selected, such as the //create and assign// assign-to field. Since jQuery ready handlers executed in the order they are added, this JavaScript executes after autoSubmit initializes.
    1010
    1111With the default workflow, `create` action will be selected when loading the New Ticket page.
     
    2121[[Image("Screen Shot 2020-05-16 at 15.06.43.jpg")]]
    2222
    23 I tried to solve this in several ways by executing the JavaScript in `ticket_workflow.html` immediately after the elements are created rather than adding a document ready handler. This results in a flicker in which the element is shown for milliseconds without being disabled. So I tried hiding the entire form element until the JavaScript is executed. It's a bit messy.
     23I tried to solve this in several ways. First, by executing the JavaScript in `ticket_workflow.html` immediately after the elements are created rather than adding a document ready handler. This results in a flicker in which the element is shown for milliseconds without being disabled. Then, I tried hiding the entire form element until the JavaScript is executed, but it makes for complex code.
    2424
    25 Or we could move the `script` block in `ticket.html` to the end of the page.
     25Another option would be to move the `script` block in `ticket.html` to the end of the page, so that the document ready handler is positioned after the one in `ticket_workflow.html`.
    2626
    27 It looks like we can just initialize `values` on the first trigger, because we trigger on element losing focus (`blur`) as well as keydown, and `values` gets initialized before any elements of the form are changed.
     27There appears to be a simpler solution. It looks like we can just initialize `values` on the first trigger, because we trigger on element losing focus (`blur`) as well as keydown, and `values` gets initialized before any elements of the form are changed.
    2828{{{#!diff
    2929diff --git a/trac/htdocs/js/auto_preview.js b/trac/htdocs/js/auto_preview.js