mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
fix trigger in JS logic
This commit is contained in:
Vendored
+1
-1
@@ -1 +1 @@
|
||||
function condition_fields(){var d=0,n=[],y=n.length,l="show";jQuery(".um-profile-body .um-field, .um-profile-body .um-field").each(function(){var e=jQuery(this).attr("data-conds");if(e){var i=JSON.parse(e);jQuery.each(i,function(){var e,i=this[0],s=this[1],a=this[2],o=this[3],r=this[5],h=jQuery('.um-profile-body .um-field[data-key="'+s+'"] .um-field-area input'),t=jQuery('.um-profile-body .um-field[data-key="'+s+'"] .um-field-area>select'),u=jQuery('.um-profile-body .um-field[data-key="'+s+'"] .um-field-area>textarea'),c=jQuery('.um-profile-body .um-field[data-key="'+s+'"] .um-field-block');0<h.length&&0===t.length?h.is(":checkbox")?jQuery('.um-profile-body .um-field[data-key="'+s+'"] input:checked').each(function(){jQuery(this).val()===o&&(e=o)}):e=h.is(":radio")?jQuery('.um-profile-body .um-field[data-key="'+s+'"] input:checked').val():h.val():0<t.length?e=0<jQuery.inArray(o,t.val())?o:t.val():0<u.length?e=u.val():0<c.length&&(e=c.text());if(parseInt(r)!==d){if("show"===i)switch(a){case"equals to":l=e==o?"show":"hide";break;case"not equals":l=e!=o?"show":"hide";break;case"empty":l=e&&""!==e?"hide":"show";break;case"not empty":l=e&&""!==e?"show":"hide";break;case"greater than":l=jQuery.isNumeric(o)&&jQuery.isNumeric(e)&&e<o?"show":"hide";break;case"less than":l=jQuery.isNumeric(o)&&jQuery.isNumeric(e)&&o<e?"show":"hide";break;case"contains":l=0<=e.search(o)?"show":"hide"}else switch(a){case"equals to":l=e==o?"hide":"show";break;case"not equals":l=e!=o?"hide":"show";break;case"empty":l=e&&""!==e?"show":"hide";break;case"not empty":l=e&&""!==e?"hide":"show";break;case"greater than":l=jQuery.isNumeric(o)&&jQuery.isNumeric(e)&&e<o?"hide":"show";break;case"less than":l=jQuery.isNumeric(o)&&jQuery.isNumeric(e)&&o<e?"hide":"show";break;case"contains":l=0<=e.search(o)?"hide":"show"}d++,n.push(l)}else{if("show"===i)switch(a){case"equals to":l=e==o?"show":"not_show";break;case"not equals":l=e!=o?"show":"not_show";break;case"empty":l=e&&""!==e?"not_show":"show";break;case"not empty":l=e&&""!==e?"show":"not_show";break;case"greater than":l=jQuery.isNumeric(o)&&jQuery.isNumeric(e)&&e<o?"show":"not_show";break;case"less than":l=jQuery.isNumeric(o)&&jQuery.isNumeric(e)&&o<e?"show":"not_show";break;case"contains":l=0<=e.search(o)?"show":"not_show"}else switch(a){case"equals to":l=e==o?"hide":"not_hide";break;case"not equals":l=e!=o?"hide":"not_hide";break;case"empty":l=e&&""!==e?"not_hide":"hide";break;case"not empty":l=e&&""!==e?"hide":"not_hide";break;case"greater than":l=jQuery.isNumeric(o)&&jQuery.isNumeric(e)&&e<o?"hide":"not_hide";break;case"less than":l=jQuery.isNumeric(o)&&jQuery.isNumeric(e)&&o<e?"hide":"not_hide";break;case"contains":l=0<=e.search(o)?"hide":"not_hide"}n[y]?"show"===n[y]||"not_hide"===n[y]?n[y]="show"===l||"not_hide"===l?"show":"hide":n[y]="hide":n[y]="show"===l||"not_hide"===l?"show":"hide"}}),jQuery.inArray("show",n)<0?jQuery(this).hide():jQuery(this).show()}})}jQuery(document).ready(function(){condition_fields(),jQuery(".um-profile-body .um-field input, .um-profile-body .um-field textarea").on("keyup",function(){condition_fields()}),jQuery(".um-profile-body .um-field select").on("change",function(){condition_fields()})});
|
||||
function condition_fields(){var d=0,n=[],y=n.length,l="show";jQuery(".um-profile-body .um-field, .um-profile-body .um-field").each(function(){var e=jQuery(this).attr("data-conds");if(e){var i=JSON.parse(e);jQuery.each(i,function(){var e,i=this[0],s=this[1],a=this[2],o=this[3],r=this[5],h=jQuery('.um-profile-body .um-field[data-key="'+s+'"] .um-field-area input'),t=jQuery('.um-profile-body .um-field[data-key="'+s+'"] .um-field-area>select'),u=jQuery('.um-profile-body .um-field[data-key="'+s+'"] .um-field-area>textarea'),c=jQuery('.um-profile-body .um-field[data-key="'+s+'"] .um-field-block');0<h.length&&0===t.length?h.is(":checkbox")?jQuery('.um-profile-body .um-field[data-key="'+s+'"] input:checked').each(function(){jQuery(this).val()===o&&(e=o)}):e=h.is(":radio")?jQuery('.um-profile-body .um-field[data-key="'+s+'"] input:checked').val():h.val():0<t.length?e=0<jQuery.inArray(o,t.val())?o:t.val():0<u.length?e=u.val():0<c.length&&(e=c.text());if(parseInt(r)!==d){if("show"===i)switch(a){case"equals to":l=e==o?"show":"hide";break;case"not equals":l=e!=o?"show":"hide";break;case"empty":l=e&&""!==e?"hide":"show";break;case"not empty":l=e&&""!==e?"show":"hide";break;case"greater than":l=jQuery.isNumeric(o)&&jQuery.isNumeric(e)&&e<o?"show":"hide";break;case"less than":l=jQuery.isNumeric(o)&&jQuery.isNumeric(e)&&o<e?"show":"hide";break;case"contains":l=0<=e.search(o)?"show":"hide"}else switch(a){case"equals to":l=e==o?"hide":"show";break;case"not equals":l=e!=o?"hide":"show";break;case"empty":l=e&&""!==e?"show":"hide";break;case"not empty":l=e&&""!==e?"hide":"show";break;case"greater than":l=jQuery.isNumeric(o)&&jQuery.isNumeric(e)&&e<o?"hide":"show";break;case"less than":l=jQuery.isNumeric(o)&&jQuery.isNumeric(e)&&o<e?"hide":"show";break;case"contains":l=0<=e.search(o)?"hide":"show"}d++,n.push(l)}else{if("show"===i)switch(a){case"equals to":l=e==o?"show":"not_show";break;case"not equals":l=e!=o?"show":"not_show";break;case"empty":l=e&&""!==e?"not_show":"show";break;case"not empty":l=e&&""!==e?"show":"not_show";break;case"greater than":l=jQuery.isNumeric(o)&&jQuery.isNumeric(e)&&e<o?"show":"not_show";break;case"less than":l=jQuery.isNumeric(o)&&jQuery.isNumeric(e)&&o<e?"show":"not_show";break;case"contains":l=0<=e.search(o)?"show":"not_show"}else switch(a){case"equals to":l=e==o?"hide":"not_hide";break;case"not equals":l=e!=o?"hide":"not_hide";break;case"empty":l=e&&""!==e?"not_hide":"hide";break;case"not empty":l=e&&""!==e?"hide":"not_hide";break;case"greater than":l=jQuery.isNumeric(o)&&jQuery.isNumeric(e)&&e<o?"hide":"not_hide";break;case"less than":l=jQuery.isNumeric(o)&&jQuery.isNumeric(e)&&o<e?"hide":"not_hide";break;case"contains":l=0<=e.search(o)?"hide":"not_hide"}n[y]?"show"===n[y]||"not_hide"===n[y]?n[y]="show"===l||"not_hide"===l?"show":"hide":n[y]="hide":n[y]="show"===l||"not_hide"===l?"show":"hide"}}),jQuery.inArray("show",n)<0?jQuery(this).hide():jQuery(this).show()}})}jQuery(document).ready(function(){condition_fields(),jQuery(".um-profile-body .um-field input, .um-profile-body .um-field textarea").on("change keyup",function(){condition_fields()}),jQuery(".um-profile-body .um-field select").on("change",function(){condition_fields()})});
|
||||
Reference in New Issue
Block a user