You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue #6299 made a case to add className to popup options, hence making it possible to style the entire popup. I'm in a position where that style changes dynamically every second or so, and would want to update the specific popup to reflect the new style.
Suggestions
A method added to the Popup class, toggleClass that will give me the ability remove/add a class dynamically since className is basically a proxy to classList.add
A method added to the Popup class, setClassName that will give me the ability where I update all the classes in one call
Mockup
constmyPop=newPopup({className: 'rounded offline'}).setText('This is my home')// .....in some evented scenario for suggestion-1listener.on('new-event',(x)=>{x.toggleClass('is-open')})// .....same scenario for suggestion-2 with more contextlistener.on('new-event',(x)=>{x.setClassName(x.online ? 'rounded online' : 'rounded offline')})
I would prefer the second one as it fits my context the most.
The text was updated successfully, but these errors were encountered:
Motivation
Issue #6299 made a case to add
className
to popup options, hence making it possible to style the entire popup. I'm in a position where that style changes dynamically every second or so, and would want to update the specific popup to reflect the new style.Suggestions
Popup
class,toggleClass
that will give me the ability remove/add a class dynamically sinceclassName
is basically a proxy toclassList.add
Popup
class,setClassName
that will give me the ability where I update all the classes in one callMockup
I would prefer the second one as it fits my context the most.
The text was updated successfully, but these errors were encountered: