/* * Copyright 2005- by IONIC Software S.A., * 18 Av Wallonie, 4460 Grace-Hollogne, Belgium. * All rights reserved. * * This software is the confidential and proprietary information * of IONIC Software S.A.("Confidential Information"). * You shall not disclose such Confidential Information and shall use * it only in accordance with the terms of the license agreement * you entered into with IONIC Software. */ var _$rf; /** * @private */ function _doSearchForRootWindow () { var curWin = window; if ((curWin != curWin.parent) && (! curWin.IONIC || ! curWin.IONIC.api || ! curWin.IONIC.api.maps || ! curWin.IONIC.api.maps.Map)) { // // Check for the presence of an arbitrary value that should only exist on the webapp root // if (curWin.parent.IONIC && // curWin.IONIC.api && // curWin.IONIC.api.maps && // curWin.IONIC.api.maps.Map) { // curWin = curWin.parent; // } else { // // Otherwise, search on parents // curWin = curWin.parent.getWebappRoot (); // } curWin = curWin.top; } while (curWin.opener && (! curWin.IONIC || ! curWin.IONIC.api || ! curWin.IONIC.api.maps || ! curWin.IONIC.api.maps.Map)) { curWin = curWin.opener.getWebappRoot(); } return curWin; } /** * Finds the root window of the application. * @return The root window. */ function getWebappRoot () { if (! _$rf) _$rf = _doSearchForRootWindow (); return _$rf; } /** * @private */ function _root(){ return getWebappRoot (); }