Conditional logic and metabox group issue

Support MB Conditional Logic Conditional logic and metabox group issue

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2046
    tandoigaitandoigai
    Participant

    I found a useful topic for this issue, however I've workaroud & found a solution myself by editing conditional-logic.js file

    Hope you'll fix this issue so that we don't need to wrap anything 😉

    /**
    	 * Visible field or entire meta box
    	 * 
    	 * @param  Element element Element Selector
    	 * 
    	 * @return void
    	 */
    	function applyVisible($element)
    	{
    		// Element is a Meta Box. Show entire Meta Box
    		if ($element.hasClass('postbox')) {
    			$element.show().attr('data-visible', 'visible');
    			return;
    		}
    		
    		// Element is a Field. Find the field wrapper and show.
    		if ($element.closest('.rwmb-field').length) {
                if ( $element.closest( '.rwmb-field' ).closest( '.rwmb-group-wrapper' ).length ) {
                    $element.closest( '.rwmb-field' ).closest( '.rwmb-group-wrapper' ).show().attr('data-visible', 'visible');
                    return;
                } else {
                    $element.closest( '.rwmb-field' ).show().attr('data-visible', 'visible');
                    return;
                }
    		}
    
    		$element.show();
    	}
    
    	/**
    	 * Hide field or entire meta box
    
    	 * @param  Element element Element Selector
    	 * 
    	 * @return void
    	 */
    	function applyHidden($element)
    	{
    		if ($element.hasClass('postbox')) {
    			$element.hide().attr('data-visible', 'hidden');
    			return;
    		}
    
    		if ($element.closest('.rwmb-field').length) {
                if ( $element.closest( '.rwmb-field' ).closest( '.rwmb-group-wrapper' ).length ) {
                    $element.closest( '.rwmb-field' ).closest( '.rwmb-group-wrapper' ).hide().attr('data-visible', 'hidden');
                    return;
                } else {
                    $element.closest('.rwmb-field').hide().attr('data-visible', 'hidden');
                    return;
                }
    		}
    
    		$element.hide();
    	}

    Best Regards

    #2051
    Tan NguyenTan Nguyen
    Participant

    Thanks for your contributing, we're in progress to update this extension 😉 Very appreciated.

    #2089
    Tan NguyenTan Nguyen
    Participant

    Btw, I have just updated MB Conditional Logic 🙂

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Conditional logic and metabox group issue’ is closed to new replies.