The CreatorCon Call for Content is officially open! Get started here.

HTML Help text Service Portal

Brian Lancaster
Tera Sage

I have the following code to make it so that I could use HTML in the help text.   This is in an on load script that is in the catalog item client scripts.   How can I get this to work in the new Service Portal?

function onLoad() {

  //Type appropriate comment here, and begin script below

  $$("div.sc-help-text").each(function(item){  

  var textValue = item.innerText;  

  $(item).update(textValue);  

  });  

}

1 ACCEPTED SOLUTION

Hi Brian,



I checked this issue and found that the   problem was with the page load time so I added timeout function which will get execute after 1.5 seconds.


Please find below updated script :



function($timeout) {


  /* widget controller */


  var c = this;


  $timeout(function() {


  jQuery('p.help-block').each(function() {


  jQuery(this).html(jQuery(this).text());


  });


  }, 1500, false);



}


Screen Shot 2017-06-27 at 5.05.17 PM.png


View solution in original post

21 REPLIES 21

Hi Brian,



I checked this issue and found that the   problem was with the page load time so I added timeout function which will get execute after 1.5 seconds.


Please find below updated script :



function($timeout) {


  /* widget controller */


  var c = this;


  $timeout(function() {


  jQuery('p.help-block').each(function() {


  jQuery(this).html(jQuery(this).text());


  });


  }, 1500, false);



}


Screen Shot 2017-06-27 at 5.05.17 PM.png


Thanks for all you help


Hello Chirag,



The fix works well. I was wondering if you figure out how you can make it show the title and the arrow to collapse/uncollapse the text? Thanks!


And just to confirm when you said client controller you meant to put it in the client scripts correct?


Technically Yes


Screen Shot 2017-06-27 at 12.28.49 AM.png