Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This retrieves the tab number from the cookies. The return value is either undefined or "0", "1", "2".
- var defaultLang = Cookies.get('language');
- // So defaultLang is a string. In order to pass it to Spry, we need to convert it to a number. This can be done by multiplying it by 1.
- (function() {
- if(defaultLang)
- return defaultLang * 1;
- else
- return 0;
- })()
- // This function returns the numeric value of defaultLang if it is set. If not, it returns 0. This function can be replaced by the following "short-hand expression". The top line is meant to explain what is happening.
- // if(x) x * 1 else 0
- defaultLang ? defaultLang * 1 : 0
- var tp1 = Spry.Widget.TabbedPanels("streamtabs", { defaultTab: defaultLang ? defaultLang * 1 : 0 });
Advertisement
Add Comment
Please, Sign In to add comment