...
Example Usage | Arguments | Return Value |
---|---|---|
ts.theme(x ); |
| if if |
toggleTheme
Toggle the current theme to the next theme in the theme list. Currently it toggles between the 'light' and 'dark' themes (see above).
Example Usage | Arguments | Return Value |
---|---|---|
ts.toggleTheme(); | none | the current theme that it was toggled to as a string |
addListener
Add a listener to a theme event. Currently, the only theme event is "themeChange".
Example Usage | Arguments | Return Value |
---|---|---|
ts.addListener(callback ); |
event: 'themeChange', value: <the current theme as a string> |
removeListener
...
An object containing: id: Number of which listener ID this is cb: error: 'No callback defined' (if there was a problem) |
removeListener
Remove a theme event listener.
Example Usage | Arguments | Return Value |
---|---|---|
ts.removeListener(lsnr ); | lsnr - the object that was returned from addListener | none, but removes the listener and callback from the themeChange event |