#104607
Peter
Participant

I’m only setting an empty div if there is no template object, just like your online demo showed.

The conditions are checked just after this to determine what the content (innerHTML) of the div should be if any.

There are no occasion where the conditions are not checked. In all and any case, the innerHTML is being set to either: ”, ‘<some fa icon A>’ or ‘<some fa icon B>’.

The lines:

if (!formatObject.template)
{
    formatObject.template = '<div></div>';
}

Are not part of the conditions checks, they are standalone before any conditions are checked.

As far as I can tell, the code does the exact same thing, with half the lines of code more or less, or am I missing something?

  • This reply was modified 1 year, 2 months ago by Peter.
  • This reply was modified 1 year, 2 months ago by Peter.
  • This reply was modified 1 year, 2 months ago by Peter.