Hi,
I am having problems with “getting used” to UI, I wish to simplify it for myself using custom javascript. On ticket view, I wish to:
- not have visible default input text field for creating a note,
- have a link “add note” next to “reply” link.
Here’s the code I have so far (you can just paste it and run in chrome console):
var style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = ' \
.editControls .js-selectInternalPublic, \
a[data-type="internal"], \
a[data-type="public"], \
a[data-type="split"], \
.editControls [data-value="phone"], \
.article-new { \
display:none; \
} \
';
document.getElementsByTagName('head')[0].appendChild(style);
var div = '<a href="" class="x-note article-action js-ArticleAction u-clickable"><svg class="icon icon-note article-action-icon"><use xlink:href="assets/images/icons.svg#icon-note"></use></svg><span class="article-action-name">add note</span></a>';
$('.js-article-actions .article-actions').prepend(div);
$('.x-note').click(function() {
$('.article-new').toggle();
});
It more or less works. But when clicking “add note” link, I wish it to also trigger action which is being called when switching article type (the action which is in controls next to input text area to switch from email to note). Can you tell me how can I switch currently selected reply type to note via javascript?
Thanks