Add a script to add support for RTL when enabled to fix chosen. Fixes #3604

@coenjacobs maybe for .14?
This commit is contained in:
Mike Jolley 2013-09-02 14:22:53 +01:00
parent e5c8ed0383
commit d1b020b661
5 changed files with 13 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@ -3140,11 +3140,6 @@ table.bar_chart {
/* Chosen multiselect enhancement
----------------------------------*/
#woocommerce_allowed_countries_chosen, #woocommerce_file_download_method_chosen {
.chosen-search {
display: none;
}
}
.chosen-container-single .chosen-single {
height: 24px;
line-height: 25px;

View File

@ -0,0 +1,6 @@
jQuery(document).ready(function($) {
// Fix Chosen for RTL
$('.chosen_select, .chosen_select_nostd, .woocommerce_attributes select.multiselect, select.country_select, select.state_select, select#dropdown_shop_coupon_type, select[name=m], select#dropdown_shop_order_status').addClass('chosen-rtl');
});

1
assets/js/chosen/chosen-rtl.min.js vendored Normal file
View File

@ -0,0 +1 @@
jQuery(document).ready(function(e){e(".chosen_select, .chosen_select_nostd, .woocommerce_attributes select.multiselect, select.country_select, select.state_select, select#dropdown_shop_coupon_type, select[name=m], select#dropdown_shop_order_status").addClass("chosen-rtl")});

View File

@ -220,6 +220,11 @@ class WC_Admin_Assets {
wp_enqueue_script( 'flot-pie', WC()->plugin_url() . '/assets/js/admin/jquery.flot.pie' . $suffix . '.js', array( 'jquery', 'flot' ), '1.0' );
wp_enqueue_script( 'flot-stack', WC()->plugin_url() . '/assets/js/admin/jquery.flot.stack' . $suffix . '.js', array( 'jquery', 'flot' ), '1.0' );
}
// Chosen RTL
if ( is_rtl() ) {
wp_enqueue_script( 'chosen-rtl', WC()->plugin_url() . '/assets/js/chosen/chosen-rtl' . $suffix . '.js', array( 'jquery' ), $woocommerce->version, true );
}
}
/**