This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Tooltip and Additional Class
#1
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.
Reply
#2
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
Reply
#3
Thanks admin, this is very helpful.
Reply


Forum Jump: