function SelectedTabUtils() { this._tabUtils = newObjectInStorage('SelectedTabUtils'); this.setSelectedTab = function setSelectedTab(lensId, tabName) { var tabsObj = this._tabUtils.get(); // get the object from session storage tabsObj[lensId] = tabName; this._tabUtils.set(tabsObj); }; this.getSelectedTab = function getSelectedTab(lensId) { // returns name of selected tab, eg // when // how // examples // video // or an empty string if lens id not found, ie no value stored for that lens var tabsObj = this._tabUtils.get(); // get the object var tabName = tabsObj[lensId]; if (typeof tabName === "undefined") { tabName = ''; } return tabName; }; }