() => { let formElement = form.getDOM(); let url = formElement.action; let formSelector = 'form' + Liferay.SPA.navigationExceptionSelectors; if (match(formElement, formSelector) && app.canNavigate(url) && (formElement.method !== 'get') && !app.isInPortletBlacklist(formElement)) { Liferay.Util._submitLocked = false; globals.capturedFormElement = formElement; const buttonSelector = 'button:not([type]),button[type=submit],input[type=submit]'; if (match(globals.document.activeElement, buttonSelector)) { globals.capturedFormButtonElement = globals.document.activeElement; } else { globals.capturedFormButtonElement = form.one(buttonSelector); } app.navigate(utils.getUrlPath(url)); } else { formElement.submit(); } }
tracked.forEach((resource) => { var resourceKey = this.getResourceKey_(resource); // Do not load permanent resources if already in document. if (!HtmlScreen.permanentResourcesInDoc[resourceKey]) { frag.appendChild(resource); } // If resource has key and is permanent add to cache. if (resourceKey && match(resource, selectorPermanent)) { HtmlScreen.permanentResourcesInDoc[resourceKey] = true; } });
/** * Customizes logic to append styles into document. Relevant to when * tracking a style by id make sure to re-positions the new style in the * same dom order. * @param {Element} newStyle */ appendStyleIntoDocument_(newStyle) { var isTemporaryStyle = match(newStyle, HtmlScreen.selectors.stylesTemporary); if (isTemporaryStyle) { this.pendingStyles.push(newStyle); } if (newStyle.id) { var styleInDoc = globals.document.getElementById(newStyle.id); if (styleInDoc) { styleInDoc.parentNode.insertBefore(newStyle, styleInDoc.nextSibling); return; } } globals.document.head.appendChild(newStyle); }