Logic Machine Forum
Tooltip and Additional Class - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Visualization (https://forum.logicmachine.net/forumdisplay.php?fid=9)
+--- Thread: Tooltip and Additional Class (/showthread.php?tid=4451)



Tooltip and Additional Class - Ibrahim - 16.12.2022

Hello,

I need tooltip for the visualization elements and I found the thread in the forum and it is ok.

My question is that is it possible to add the "tooltip" to additional classes of all elements in one time? Because there are too many elements and it takes time to add the one by one? 

Thanks.


RE: Tooltip and Additional Class - admin - 16.12.2022

Run this script once:
Code:
objs = db:getall('SELECT id, cls FROM visobjects WHERE cls NOT LIKE "%tooltip%"')

for _, obj in ipairs(objs) do
  cls = obj.cls

  if type(cls) == 'string' and #cls > 0 then
    cls = cls .. ' tooltip'
  else
    cls = 'tooltip'
  end

  db:update('visobjects', { cls = cls }, { id = obj.id })
end



RE: Tooltip and Additional Class - Ibrahim - 16.12.2022

Thanks admin, this is very helpful.