Fix show/hide conditional fields for IE browser

This commit is contained in:
Champ Camba
2017-11-01 20:05:10 +08:00
parent 41b8bc541b
commit fbfbf58ad2
2 changed files with 27 additions and 3 deletions
+26 -2
View File
@@ -315,20 +315,24 @@ jQuery(document).ready( function (){
if (condition.action == 'show' && is_true /*&& child_dom.is(':hidden')*/) {
child_dom.show();
_show_in_ie( child_dom );
um_field_restore_default_value(child_dom);
}
if (condition.action == 'show' && !is_true /*&& child_dom.is(':visible') */) {
child_dom.hide();
_hide_in_ie( child_dom );
}
if (condition.action == 'hide' && is_true /*&& child_dom.is(':visible')*/) {
child_dom.hide();
}
_hide_in_ie( child_dom );
}
if (condition.action == 'hide' && !is_true /*&& child_dom.is(':hidden')*/) {
child_dom.show();
um_field_restore_default_value(child_dom);
_show_in_ie( child_dom );
um_field_restore_default_value( child_dom );
}
$dom.removeClass('um-field-has-changed');
@@ -452,6 +456,26 @@ jQuery(document).ready( function (){
}
/**
* Hides div for IE browser
* @param object $dom
*/
function _hide_in_ie( $dom ){
if( jQuery.browser.msie ){
$dom.css({"visibility":"hidden"});
}
}
/**
* Shows div for IE browser
* @param object $dom
*/
function _show_in_ie( $dom ){
if( jQuery.browser.msie ){
$dom.css({"visibility":"visible"});
}
}
jQuery(document).on('change', '.um-field select, .um-field input[type=radio], .um-field input[type=checkbox]', function () {
var me = jQuery(this);
um_apply_conditions(me, false);
+1 -1
View File
File diff suppressed because one or more lines are too long