Can I move the email icon in UI16 back to where it was in UI15?

aessling
Mega Expert

In UI15 the email icon in tickets was on the bar at the top of the window. Now I have to click on more More options button and then select Email. Is there any way to move the Email icon back on to the bar?

UI15

email ui15.png

UI16

email ui16.png

1 ACCEPTED SOLUTION

josephcustodio
Mega Contributor
12 REPLIES 12

Shay Faingold
Mega Expert

Hi Anthony,



Did you manage to find a solution for that? I was able to get this far:



find_real_file.png


Using this UI Script:



document.addEventListener("DOMContentLoaded", function(event) {


  var essLink ="<span class='btn btn-icon icon-mail' onclick=;emailClientOpen(this,'incident')'/>";


  document.querySelector("#section-bf1d96e3c0a801640190725e63f8ac80 > nav > span").innerHTML = essLink;


  });



Its still not perfect, but I think I got the first step of getting this out of that list, into the form and now need the professionals (you) to help?



any thoughts about what can be done to make it work & aligned to the Attachment field?



Thank you,


Shay


I would take a step back and consider if it's work to have a UI Script for this. DOM manipulation isn't something that is recommended and will to 99% lead to be broken in new releases since they tend to change the way they ID or use Class etc.



Just a note.



//Göran


adamn
Tera Contributor

document.observe("dom:loaded", function() {


  var emailButton = $('email_client_open');


  if(emailButton != undefined){


  var newEmailButton = emailButton.clone();


  newEmailButton.innerHTML = '';


  newEmailButton.src = 'images/icons/email.gifx';


  newEmailButton.addClassName('btn');


  newEmailButton.addClassName('btn-icon');


  $('header_add_attachment').insert({before: newEmailButton});


  }


});



Give this UI Script a shot (enable Globally)



This inserts the button as a button element BEFORE the Attachment button and attaches the correct event. It also sources the item itself from the submenu one so if the record shouldnt have the email client available, it will not add itself.



Tested in UI16 Helsinki P4



Let me know if it works for you



EDIT: Small Simplification to Code


Hello,



I tested this and it works fine, but it leaves the old mail button in . . . so do you think that you could remove it?


Hi,



Try this:




function onLoad() {


  if (!!!g_scratchpad.isConcourse || g_form.isNewRecord())


  return;



  var navbarNode = document.getElementsByClassName('navbar-right')[0];


  var emailNode = document.getElementById('email_client_open');


  if (emailNode) {


  // just a bit of optional styling:


  emailNode.innerHTML = '';


  emailNode.className += ' btn btn-icon';



  navbarNode.insertBefore(emailNode, navbarNode.childNodes[0]);


  }


}