WordPress.org

Making WordPress.org


Ignore:
Timestamp:
06/05/2018 06:27:30 PM (3 years ago)
Author:
vedjain
Message:

WordCamp-Payments: Add select2 to most select fields for better UX

In budget-tools.js, there was also an undetachted even handler, which was causing rendering of select box multiple times. That is also fixed in this commit. This is mostly a UX change.

Fixes #3241
Props vedanshu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/budget-tool.php

    r6067 r7267  
    8787    }
    8888
    89     public static function enqueue_scripts() {
    90         $screen = get_current_screen();
    91         if ( $screen->id == 'toplevel_page_wordcamp-budget' ) {
    92             wp_enqueue_script( 'wcb-budget-tool',
    93                 plugins_url( 'javascript/budget-tool.js', __DIR__ ),
    94                 array( 'backbone', 'jquery', 'jquery-ui-sortable', 'heartbeat', 'underscore' ), 3 , true );
    95         }
    96     }
     89    public static function enqueue_scripts() {
     90        $screen = get_current_screen();
     91
     92        wp_enqueue_script( 'select2' );
     93        wp_enqueue_style( 'select2' );
     94
     95        if ( $screen->id == 'toplevel_page_wordcamp-budget' ) {
     96            wp_enqueue_script( 'wcb-budget-tool',
     97                plugins_url( 'javascript/budget-tool.js', __DIR__ ),
     98                array( 'backbone', 'jquery', 'jquery-ui-sortable', 'heartbeat', 'underscore', 'select2' ), 3 , true );
     99        }
     100    }
    97101
    98102    private static function _get_budget() {
Note: See TracChangeset for help on using the changeset viewer.