{"version":3,"sources":["llms-metabox-instructors.js"],"names":["$","window","llms","metabox_instructors","this","init","on","e","params","author_id","$el","find","first","val","$instructor","$row","$target","text","data","html","trigger","jQuery"],"mappings":"CAMA,SAAYA,GAEXC,OAAOC,KAAOD,OAAOC,MAAQ,GAE7BD,OAAOC,KAAKC,oBAAsB,WASjCC,KAAKC,KAAO,WAIXL,EAAG,oCAAqCM,GAAI,4BAA6B,SAAUC,EAAGC,GACrF,IAAIC,EAAYD,EAAOE,IAAIC,KAAM,0CAA2CC,QAAQD,KAAM,4BAA6BE,MACvHb,EAAG,gBAAiBa,IAAKJ,KAG1BT,EAAG,oCAAqCM,GAAI,wBAAyB,SAAUC,EAAGC,GAEjF,IAAIM,EAAcN,EAAOO,KAAKJ,KAAM,4BACnCK,EAAcR,EAAOO,KAAKJ,KAAM,wBAEjCG,EAAYR,GAAI,iBAAkB,SAAUC,GACpCA,EAAEC,OAGRQ,EAAQC,KAAMV,EAAEC,OAAOU,KAAKD,MAF5BD,EAAQG,KAAML,EAAYH,KAAM,+BAAgCQ,UAI9DC,QAAS,qBAOfhB,KAAKC,QAIE,IAAIJ,OAAOC,KAAKC,oBA5CzB,CA8CKkB","file":"../../js/llms-metabox-instructors.min.js","sourcesContent":["/**\n * Instructors Metabox\n *\n * @since    3.13.0\n * @version  3.13.0\n */\n( function( $ ) {\n\n\twindow.llms = window.llms || {};\n\n\twindow.llms.metabox_instructors = function() {\n\n\t\t/**\n\t\t * Initialize\n\t\t *\n\t\t * @return  void\n\t\t * @since   3.13.0\n\t\t * @version 3.13.0\n\t\t */\n\t\tthis.init = function() {\n\n\t\t\t// before saving, update the wp core hidden field for post_author\n\t\t\t// so that the first instructor is always set as the post author\n\t\t\t$( '._llms_instructors_data.repeater' ).on( 'llms-repeater-before-save', function( e, params ) {\n\t\t\t\tvar author_id = params.$el.find( '.llms-repeater-rows .llms-repeater-row' ).first().find( 'select[name^=\"_llms_id\"]' ).val();\n\t\t\t\t$( '#post_author' ).val( author_id );\n\t\t\t} );\n\n\t\t\t$( '._llms_instructors_data.repeater' ).on( 'llms-new-repeater-row', function( e, params ) {\n\n\t\t\t\tvar $instructor = params.$row.find( 'select[name^=\"_llms_id\"]' ),\n\t\t\t\t\t$target     = params.$row.find( '.llms-repeater-title' );\n\n\t\t\t\t$instructor.on( 'select2:select', function( e ) {\n\t\t\t\t\tif ( ! e.params ) {\n\t\t\t\t\t\t$target.html( $instructor.find( 'option[selected=\"selected\"]' ).html() );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$target.text( e.params.data.text );\n\t\t\t\t\t}\n\t\t\t\t} ).trigger( 'select2:select' );\n\n\t\t\t} );\n\n\t\t};\n\n\t\t// go\n\t\tthis.init();\n\n\t};\n\n\tvar a = new window.llms.metabox_instructors();\n\n} )( jQuery );\n"],"sourceRoot":"../../js"}