Plugin Directory

Changeset 1397714


Ignore:
Timestamp:
04/17/2016 12:20:06 PM (10 years ago)
Author:
bogdand
Message:

fix tab issue

Location:
acf-accordion/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • acf-accordion/trunk/acf-accordion.php

    r1259199 r1397714  
    55Plugin URI: http://bogdandragomir.com/acf-accordion
    66Description: An accordion field that lets you group multiple fields under accordion tabs. This makes a long ACF form break down with style.
    7 Version: 1.1.0
     7Version: 1.1.1
    88Author: Bogdan Dragomir
    99Author URI: http://bogdandragomir.com
  • acf-accordion/trunk/js/input.js

    r1259199 r1397714  
    11(function($){
    2    
    3    
     2
     3
    44    function initialize_field( $el ) {
    5        
     5
    66        //$el.doStuff();
    7        
     7
    88    }
    9    
    10    
     9
     10
    1111    if( typeof acf.add_action !== 'undefined' ) {
    12    
     12
    1313        /*
    14         *  ready append (ACF5)
    15         *
    16         *  These are 2 events which are fired during the page load
    17         *  ready = on page load similar to $(document).ready()
    18         *  append = on new DOM elements appended via repeater field
    19         *
    20         *  @type    event
    21         *  @date    20/07/13
    22         *
    23         *  @param   $el (jQuery selection) the jQuery element which contains the ACF fields
    24         *  @return  n/a
    25         */
    26        
     14         *  ready append (ACF5)
     15         *
     16         *  These are 2 events which are fired during the page load
     17         *  ready = on page load similar to $(document).ready()
     18         *  append = on new DOM elements appended via repeater field
     19         *
     20         *  @type   event
     21         *  @date   20/07/13
     22         *
     23         *  @param  $el (jQuery selection) the jQuery element which contains the ACF fields
     24         *  @return n/a
     25         */
     26
    2727        acf.add_action('ready', function( $el ){
    28            
     28
    2929            // search $el for fields of type 'accordion'
    3030            acf.get_fields({ type : 'accordion' }, $el).each(function(){
    31                
     31
    3232                initialize_field( $(this) );
    33                 $(this).nextUntil(".field_type-tab, .acf-field-accordion").wrapAll('<div class="acf-accordion-group"></div>');
     33                $(this).nextUntil(".acf-field-tab, .acf-field-accordion").wrapAll('<div class="acf-field acf-accordion-group"></div>');
    3434            });
    35                    
     35
    3636            $(".acf-field-accordion").click(function () {
    3737                var toggler = $(this);
     
    4040                    toggler.next(".acf-accordion-group").removeClass("opened");
    4141                } else {
    42                     $(".acf-field-accordion.opened").removeClass('opened');
    43                     toggler.addClass('opened');
    44                     $(".acf-accordion-group.opened").removeClass("opened");
    45                     toggler.next(".acf-accordion-group").addClass("opened");
     42                    $(".acf-field-accordion.opened").removeClass('opened').next(".acf-accordion-group").removeClass("opened");
     43                    toggler.addClass('opened').next(".acf-accordion-group").addClass("opened").children('.acf-field').each(function(){
     44                        $(this).removeClass('hidden-by-tab');
     45                    });;
    4646                    refresh_fields_google_map();
    4747                }
     
    6363
    6464        });
    65        
    66        
     65
     66
    6767    } else {
    68        
    69        
     68
     69
    7070        /*
    71         *  acf/setup_fields (ACF4)
    72         *
    73         *  This event is triggered when ACF adds any new elements to the DOM.
    74         *
    75         *  @type    function
    76         *  @since   1.0.0
    77         *  @date    01/01/12
    78         *
    79         *  @param   event       e: an event object. This can be ignored
    80         *  @param   Element     postbox: An element which contains the new HTML
    81         *
    82         *  @return  n/a
    83         */
    84        
     71         *  acf/setup_fields (ACF4)
     72         *
     73         *  This event is triggered when ACF adds any new elements to the DOM.
     74         *
     75         *  @type   function
     76         *  @since  1.0.0
     77         *  @date   01/01/12
     78         *
     79         *  @param  event       e: an event object. This can be ignored
     80         *  @param  Element     postbox: An element which contains the new HTML
     81         *
     82         *  @return n/a
     83         */
     84
    8585        $(document).on('acf/setup_fields', function(e, postbox){
    86            
     86
    8787            $(postbox).find('.field[data-field_type="accordion"]').each(function(){
    88                
     88
    8989                initialize_field( $(this) );
    9090                $(this).nextUntil(".field_type-tab, .field_type-accordion").wrapAll('<div class="acf-accordion-group"></div>');
    91                
     91
    9292            });
    93            
     93
    9494            jQuery(".field_type-accordion").on('click', function () {
    9595                var toggler = $(this);
     
    119119                }
    120120            }
    121        
    122         }); 
     121
     122        });
    123123    }
    124124})(jQuery);
  • acf-accordion/trunk/readme.txt

    r1263763 r1397714  
    44Tags: acf, accordion, advanced custom fields, tabs, options
    55Requires at least: 3.5
    6 Tested up to: 4.3.1
     6Tested up to: 4.5
    77Stable tag: trunk
    88License: GPLv2 or later
     
    1414
    1515The ACF Accordion provides an easy way to organize big forms by grouping the fields in accordion tabs. It works with horizontal tabs and it also supports WordPress icons.
     16
     17Please contribute here
     18https://github.com/bvdr/acf-accordion
    1619
    1720= Compatibility =
     
    30334. Please refer to the description for more info regarding the field type settings
    3134
     35### Including it in theme
     36
     37ACF Accordion can be included in the theme by using the `acf/accordion/dir` filter. Here is an example
     38
     39```php
     40include_once( 'includes/acf-accordion/acf-accordion.php' );
     41
     42add_filter( 'acf/accordion/dir', 'acf_accordion_dir' );
     43function acf_accordion_dir( $dir ) {
     44    $dir = get_template_directory_uri() . '/includes/acf-accordion/';
     45    return $dir;
     46}
     47```
     48
    3249== Screenshots ==
    3350
     
    3653== Changelog ==
    3754
    38 = 1.1.1 =
    39 * [Fix] icons path not working when plugin is included in theme;
     55= 1.1.1 - April 17, 2016 =
     56* [Fix] multi tabs not working with accordion, tab after accordions showing empty;
    4057
    4158= 1.1.0 =
Note: See TracChangeset for help on using the changeset viewer.