{"version":3,"sources":["ucws_common/ucws_profiles/js/ucws_profiles.js"],"names":["$","Drupal","behaviors","ucwsProfiles","attach","context","settings","$context","find","each","$this","this","$checkbox","$linkTitle","$firstName","closest","$lastName","on","data","is","val","trigger","jQuery"],"mappings":"CAAA,SAAWA,EAAGC,GACV,aACAA,EAAOC,UAAUC,aAAe,CAC9BC,OAAQ,SAAUC,EAASC,GACzB,IAAIC,EAAWP,EAAEK,GACjBE,EAASC,KAAK,mBAAmBC,MAAK,WACpC,IAAIC,EAAQV,EAAEW,MAEVC,EAAYF,EAAMF,KAAK,oCACvBK,EAAaN,EAASC,KAAK,kCAC3BM,EAAaJ,EAAMK,QAAQ,QAAQP,KAAK,8DACxCQ,EAAYN,EAAMK,QAAQ,QAAQP,KAAK,6DAE3CM,EAAWG,GAAG,SAAS,YAChBJ,EAAWK,KAAK,qCAAuCN,EAAUO,GAAG,cACvEN,EAAWO,IAAIN,EAAWM,OAC1BP,EAAWO,IAAIN,EAAWM,OAAOC,QAAQ,mBAI7CL,EAAUC,GAAG,SAAS,YACfJ,EAAWK,KAAK,qCAAuCN,EAAUO,GAAG,cACvEN,EAAWO,IAAIN,EAAWM,MAAQ,IAAMJ,EAAUI,OAClDP,EAAWO,IAAIN,EAAWM,MAAQ,IAAMJ,EAAUI,OAAOC,QAAQ,wBAvB/E,CA8BEC,OAAQrB","file":"ucws_profiles.js","sourcesContent":["(function ($, Drupal) {\n 'use strict';\n Drupal.behaviors.ucwsProfiles = {\n attach: function (context, settings) {\n var $context = $(context);\n $context.find('.menu-link-form').each(function () {\n var $this = $(this);\n\n var $checkbox = $this.find('.js-form-item-menu-enabled input');\n var $linkTitle = $context.find('.js-form-item-menu-title input');\n var $firstName = $this.closest('form').find('.js-form-item-field-ucws-profiles-first-name-0-value input');\n var $lastName = $this.closest('form').find('.js-form-item-field-ucws-profiles-last-name-0-value input');\n\n $firstName.on('keyup', function () {\n if (!$linkTitle.data('menuLinkAutomaticTitleOverridden') && $checkbox.is(':checked')) {\n $linkTitle.val($firstName.val());\n $linkTitle.val($firstName.val()).trigger('formUpdated');\n }\n });\n\n $lastName.on('keyup', function () {\n if (!$linkTitle.data('menuLinkAutomaticTitleOverridden') && $checkbox.is(':checked')) {\n $linkTitle.val($firstName.val() + ' ' + $lastName.val());\n $linkTitle.val($firstName.val() + ' ' + $lastName.val()).trigger('formUpdated');\n }\n });\n });\n }\n };\n }\n)(jQuery, Drupal);\n"]}