-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmtcf.min.js
More file actions
1 lines (1 loc) · 915 Bytes
/
mtcf.min.js
File metadata and controls
1 lines (1 loc) · 915 Bytes
1
jQuery(document).ready(function(a){if(MTCF=MTCF||{},MTCF.type_field){MTCF.toggle=function(){if(MTCF.current_user_type)for(var b in MTCF)if(MTCF.hasOwnProperty(b)&&0===b.indexOf("field_")){var g,c=MTCF[b].y,d=MTCF[b].n,e=MTCF.current_user_type,f=a('[name="'+b+'"]');f.closest(".bp-profile-field").length?g=f.closest(".bp-profile-field"):f.closest(".editfield").length&&(g=f.closest(".editfield")),f.length>0&&g.length&&(c.indexOf(e)>-1?g.fadeIn(100):d.indexOf(e)>-1&&g.fadeOut(100))}};var b=function(b){var c=a(b).val();a.trim(c)||(c="type_none"),MTCF.current_user_type=c,MTCF.toggle()};a(document).on("change",'.editfield [name="'+MTCF.type_field+'"]',function(a){return b(this)}),a(document).on("change",'.bp-profile-field [name="'+MTCF.type_field+'"]',function(a){return b(this)}),a('.editfield [name="'+MTCF.type_field+'"]').change(),a('.bp-profile-field [name="'+MTCF.type_field+'"]').change(),MTCF.toggle()}});