Edgewall Software

Changes between Initial Version and Version 1 of Ticket #13298


Ignore:
Timestamp:
May 17, 2020, 12:26:57 AM (4 years ago)
Author:
Ryan J Ollos
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #13298 – Description

    initial v1  
    44
    55The problem is due to two changes:
    6 * In r13452 the workflow controls were added to the new ticket page. We added the //create and assign// action.
    7 * 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. Since jQuery ready handlers executed in the order they are added, this JavaScript executes after autoSubmit initializes.
     6* 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.
     7* 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.
    88
    99With the default workflow, `create` action will be selected when loading the New Ticket page.
    1010
    11 [[Image(Screen Shot 2020-05-16 at 15.15.19.jpg)]]
     11[[Image("Screen Shot 2020-05-16 at 15.15.19.jpg")]]
    1212
    13 The `autoSubmit` will initialize and collect a list of all inputs which will includes the `#action_create_and_assign_reassign_owner` select.
     13The `autoSubmit` will initialize and collect a list of all inputs which will includes the `#action_create_and_assign_reassign_owner` select. After that happens, the `#action_create_and_assign_reassign_owner` select will be disabled.
    1414
    1515[[Image("Screen Shot 2020-05-16 at 15.03.45.jpg")]]
    1616
    17 Any of the events `input cut paste keydown keypress change blur` will trigger the callback, because the new array of form elements will be one-less than that which was originally stored.
     17Any of the events `input cut paste keydown keypress change blur` will trigger the autopreview, because the new array of form elements will be one-less in length than that which was originally stored (the one-less is the absence of the `#action_create_and_assign_reassign_owner` element.
    1818
    19 [[Image("Screen Shot 2020-05-16 at 15.06.43".jpg)]]
     19[[Image("Screen Shot 2020-05-16 at 15.06.43.jpg")]]
    2020
    2121I 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.
     
    2323Or we could move the `script` block in `ticket.html` to the end of the page.
    2424
    25 It looks like we can just initialize `values` on the first trigger, because we trigger on element losing focus `blur` as well as keydown, so `values` gets initialized before any elements of the form are changed.
     25It 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.
    2626{{{#!diff
    2727diff --git a/trac/htdocs/js/auto_preview.js b/trac/htdocs/js/auto_preview.js