Liferay.Loader.define("journal-web@5.0.151/js/EditFeed",["module","exports","require","frontend-js-web"],(function(e,t,n){window;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function _default({isNewJournalFeed:e,namespace:t,renderedWebContent:n}){const o=document.getElementById("".concat(t,"fm")),a=(0,d.getFormElement)(o,"contentFieldSelector"),handleFieldSelector=()=>{let e="",t="";const c=a.options[a.selectedIndex];c&&(e=c.value||"",c.dataset.contentfield===n&&(t=e,e=n)),(0,d.setFormValues)(o,{contentField:e,ddmRendererTemplateKey:t})},saveFeed=()=>{const n=document.getElementById("".concat(t,"javax-portlet-action"));let d="/journal/update_feed";e&&(d="/journal/add_feed",document.getElementById("".concat(t,"feedId")).value=document.getElementById("".concat(t,"newFeedId")).value),n.value=d,submitForm(o)};if(o){a.addEventListener("change",handleFieldSelector),o.addEventListener("submit",saveFeed);const e=document.getElementById("".concat(t,"autoFeedId")),n=document.getElementById("".concat(t,"newFeedId"));e&&n&&(n.disabled=e.checked,e.addEventListener("click",(()=>{(0,d.toggleDisabled)(n,!n.disabled)})))}return{dispose(){a.removeEventListener("change",handleFieldSelector()),o.removeEventListener("submit",saveFeed)}}};var d=n("frontend-js-web")}));
//# sourceMappingURL=EditFeed.js.map