When changing templates for TicketExtPlugin, a confirmation dialog pops up whenever the ticket type is changed. This is always done prior to warn the user of an impending update to the textarea template itself.
It is useful for the user to skip this dialog if nothing in the textarea has changed itself. This enhancement is only for immediate changes to the textarea, not to the restriction of fields, or modification of other changes made to the new ticket.
Details:
- By using an arbitrary CSS class name (in this case, changed), we can identify when the ticket has changed from the template.
- As noted, future enhancements can include checking ALL available fields in Javascript, but for now, this should be an acceptable enhancement
The following diff on file ticketext/htdocs/ticketext.js details the changes as of revision 5855:
103,104d102
< var descElem = document.getElementById(this.descId);
< $(descElem).change(function() { $(descElem).addClass("changed"); });
117d114
< if ($("textarea.changed").length > 0) {
122d118
< }
240d235
< $(descElem).removeClass("changed");
248c243
< // txtareaModeElem.click();
---
> txtareaModeElem.click();