WordPress.org

Support

Support » Plugins and Hacks » Add jquery noconflict in js files

Add jquery noconflict in js files

  • sireneweb
    Member

    @sireneweb

    Hi,
    i noticed a lot of conflict bug when you use jump menu with other plugins.
    Could you add jquery noconflict to solve this bug ?

    Check my hack in jquery.ui.position at first line :

    jQuery.noConflict();
     (function( $, undefined ) {

    at the end :

    }( jQuery ));

    Why you don’t use the jquery.ui.position.min.js in s\wordpress\wp-includes\js\jquery\ui\ ?
    You will keep everytime the compatibility with the core
    http://wordpress.org/extend/plugins/wp-jump-menu/

Viewing 3 replies - 1 through 3 (of 3 total)
  • sireneweb
    Member

    @sireneweb

    In fact when you check the source code, you’ll see the jquery.ui.position is alread loaded by wordpress core, maybe add a condition check to load the file if isn’t loaded.

    Replace

    wp_enqueue_script( 'wpjm-jquery-ui-position' );

    by

    wp_enqueue_script( 'jquery-ui-position' );

    Plugin Author James Krill
    Participant

    @jkrill

    Hi Sireneweb,

    Thanks for this. You are probably right about these things, I just have not had any time to revisit the plugin lately to improve the code. I feel like I know way more now than when I first wrote it, and could greatly improve performance and things like what you mentioned, but I haven’t been able to find the time to get in there.

    Hopefully in the next couple months I can carve out a little time to work on this.

    Jim

    sireneweb
    Member

    @sireneweb

    New fix for Gravity forms :

    in wp-jump-menu.php for admin_bar_menu() function, add this to fix bug with chosen, because chosen isn’t loaded when you edit form for gravity

    if ($this->options['useChosen'] == 'true') {
                        $html .= ".chosen({position:'".$this->options['position']."'})";
                    }

    Replace by

    if(wp_script_is('chosenjs','queue')){
                    if ($this->options['useChosen'] == 'true') {
                        $html .= ".chosen({position:'".$this->options['position']."'})";
                    }
                }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add jquery noconflict in js files’ is closed to new replies.