/* * Responsible for flyout menus within the editor + on a published page. * Also responsible for condensing overflowing nav and making a "more..." link. * * Author: Adam Shaw */ (function() { /****************************** publicly available functions ****************************/ var moreItemHTML; var activeLiId; var currentPageId; var stylePrefix = window.STYLE_PREFIX || 'weebly'; // called from a published page window.initPublishedFlyoutMenus = function(topLevelSummary, cpid, moreItemHTML, aLiId, isPreview) { currentPageId = cpid; if (topLevelSummary.length > 0) { var go = function() { activeLiId = aLiId; var container = document.createElement('div'); container.id = stylePrefix+'-menus'; $(document.body).insert(container); var firstItem = navElm(topLevelSummary[0].id); if (firstItem) { window.navFlyoutMenu = new FlyoutMenu(firstItem.up(), { relocate: container, aLiId: aLiId }); condenseNav(topLevelSummary, moreItemHTML); } } if (isPreview) { go(); // css has been written in html