Merge pull request #9073 from krautnerds/fix-inefficient-jQuery-usage
Fixed all inefficient selector usages
This commit is contained in:
commit
d7c7527529
|
@ -40,7 +40,7 @@ $(window).load(function() {
|
|||
// Search autocompletion
|
||||
var autocompleteFound = false;
|
||||
var autocompleteFiles = {'c': 'class', 'co': 'constant', 'f': 'function', 'm': 'class', 'mm': 'class', 'p': 'class', 'mp': 'class', 'cc': 'class'};
|
||||
var $search = $('#search input[name=q]');
|
||||
var $search = $('#search').find('input[name=q]');
|
||||
$search
|
||||
.autocomplete(ApiGen.elements, {
|
||||
matchContains: true,
|
||||
|
@ -92,7 +92,7 @@ $(window).load(function() {
|
|||
if ('' === query) {
|
||||
return false;
|
||||
}
|
||||
return !autocompleteFound && '' !== $('#search input[name=cx]').val();
|
||||
return !autocompleteFound && '' !== $('#search').find('input[name=cx]').val();
|
||||
});
|
||||
|
||||
// Save natural order
|
||||
|
|
|
@ -316,8 +316,8 @@ jQuery( function ( $ ) {
|
|||
data: data,
|
||||
type: 'POST',
|
||||
success: function( response ) {
|
||||
$( '#woocommerce-order-items .inside' ).empty();
|
||||
$( '#woocommerce-order-items .inside' ).append( response );
|
||||
$( '#woocommerce-order-items' ).find( '.inside' ).empty();
|
||||
$( '#woocommerce-order-items' ).find( '.inside' ).append( response );
|
||||
wc_meta_boxes_order.init_tiptip();
|
||||
wc_meta_boxes_order_items.unblock();
|
||||
wc_meta_boxes_order_items.stupidtable.init();
|
||||
|
@ -384,7 +384,7 @@ jQuery( function ( $ ) {
|
|||
$( 'div.wc-order-refund-items' ).slideDown();
|
||||
$( 'div.wc-order-bulk-actions' ).slideUp();
|
||||
$( 'div.wc-order-totals-items' ).slideUp();
|
||||
$( '#woocommerce-order-items div.refund' ).show();
|
||||
$( '#woocommerce-order-items' ).find( 'div.refund' ).show();
|
||||
$( '.wc-order-edit-line-item .wc-order-edit-line-item-actions' ).hide();
|
||||
return false;
|
||||
},
|
||||
|
@ -393,7 +393,7 @@ jQuery( function ( $ ) {
|
|||
$( this ).closest( 'div.wc-order-data-row' ).slideUp();
|
||||
$( 'div.wc-order-bulk-actions' ).slideDown();
|
||||
$( 'div.wc-order-totals-items' ).slideDown();
|
||||
$( '#woocommerce-order-items div.refund' ).hide();
|
||||
$( '#woocommerce-order-items' ).find( 'div.refund' ).hide();
|
||||
$( '.wc-order-edit-line-item .wc-order-edit-line-item-actions' ).show();
|
||||
|
||||
// Reload the items
|
||||
|
@ -506,8 +506,8 @@ jQuery( function ( $ ) {
|
|||
data: data,
|
||||
type: 'POST',
|
||||
success: function( response ) {
|
||||
$( '#woocommerce-order-items .inside' ).empty();
|
||||
$( '#woocommerce-order-items .inside' ).append( response );
|
||||
$( '#woocommerce-order-items' ).find( '.inside' ).empty();
|
||||
$( '#woocommerce-order-items' ).find( '.inside' ).append( response );
|
||||
wc_meta_boxes_order.init_tiptip();
|
||||
wc_meta_boxes_order_items.unblock();
|
||||
wc_meta_boxes_order_items.stupidtable.init();
|
||||
|
@ -556,8 +556,8 @@ jQuery( function ( $ ) {
|
|||
data: data,
|
||||
type: 'POST',
|
||||
success: function( response ) {
|
||||
$( '#woocommerce-order-items .inside' ).empty();
|
||||
$( '#woocommerce-order-items .inside' ).append( response );
|
||||
$( '#woocommerce-order-items' ).find( '.inside' ).empty();
|
||||
$( '#woocommerce-order-items' ).find( '.inside' ).append( response );
|
||||
wc_meta_boxes_order.init_tiptip();
|
||||
wc_meta_boxes_order_items.unblock();
|
||||
wc_meta_boxes_order_items.stupidtable.init();
|
||||
|
@ -626,8 +626,8 @@ jQuery( function ( $ ) {
|
|||
data: data,
|
||||
type: 'POST',
|
||||
success: function( response ) {
|
||||
$( '#woocommerce-order-items .inside' ).empty();
|
||||
$( '#woocommerce-order-items .inside' ).append( response );
|
||||
$( '#woocommerce-order-items' ).find( '.inside' ).empty();
|
||||
$( '#woocommerce-order-items' ).find( '.inside' ).append( response );
|
||||
wc_meta_boxes_order.init_tiptip();
|
||||
wc_meta_boxes_order_items.unblock();
|
||||
wc_meta_boxes_order_items.stupidtable.init();
|
||||
|
@ -1083,8 +1083,8 @@ jQuery( function ( $ ) {
|
|||
data: data,
|
||||
type: 'POST',
|
||||
success: function( response ) {
|
||||
$( '#woocommerce-order-items .inside' ).empty();
|
||||
$( '#woocommerce-order-items .inside' ).append( response );
|
||||
$( '#woocommerce-order-items' ).find( '.inside' ).empty();
|
||||
$( '#woocommerce-order-items' ).find( '.inside' ).append( response );
|
||||
wc_meta_boxes_order.init_tiptip();
|
||||
wc_meta_boxes_order_items.unblock();
|
||||
wc_meta_boxes_order_items.stupidtable.init();
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -183,7 +183,7 @@ jQuery( function( $ ) {
|
|||
* Set menu order
|
||||
*/
|
||||
variation_row_indexes: function() {
|
||||
var wrapper = $( '#variable_product_options .woocommerce_variations' ),
|
||||
var wrapper = $( '#variable_product_options' ).find( '.woocommerce_variations' ),
|
||||
current_page = parseInt( wrapper.attr( 'data-page' ), 10 ),
|
||||
offset = parseInt( ( current_page - 1 ) * woocommerce_admin_meta_boxes_variations.variations_per_page, 10 );
|
||||
|
||||
|
@ -338,7 +338,7 @@ jQuery( function( $ ) {
|
|||
* @return {Bool}
|
||||
*/
|
||||
check_for_changes: function() {
|
||||
var need_update = $( '#variable_product_options .woocommerce_variations .variation-needs-update' );
|
||||
var need_update = $( '#variable_product_options' ).find( '.woocommerce_variations .variation-needs-update' );
|
||||
|
||||
if ( 0 < need_update.length ) {
|
||||
if ( window.confirm( woocommerce_admin_meta_boxes_variations.i18n_edited_variations ) ) {
|
||||
|
@ -378,7 +378,7 @@ jQuery( function( $ ) {
|
|||
* @return {Bool}
|
||||
*/
|
||||
initial_load: function() {
|
||||
if ( 0 === $( '#variable_product_options .woocommerce_variations .woocommerce_variation' ).length ) {
|
||||
if ( 0 === $( '#variable_product_options' ).find( '.woocommerce_variations .woocommerce_variation' ).length ) {
|
||||
wc_meta_boxes_product_variations_pagenav.go_to_page();
|
||||
}
|
||||
},
|
||||
|
@ -393,7 +393,7 @@ jQuery( function( $ ) {
|
|||
page = page || 1;
|
||||
per_page = per_page || woocommerce_admin_meta_boxes_variations.variations_per_page;
|
||||
|
||||
var wrapper = $( '#variable_product_options .woocommerce_variations' );
|
||||
var wrapper = $( '#variable_product_options' ).find( '.woocommerce_variations' );
|
||||
|
||||
wc_meta_boxes_product_variations_ajax.block();
|
||||
|
||||
|
@ -442,7 +442,7 @@ jQuery( function( $ ) {
|
|||
* @param {Function} callback
|
||||
*/
|
||||
save_changes: function( callback ) {
|
||||
var wrapper = $( '#variable_product_options .woocommerce_variations' ),
|
||||
var wrapper = $( '#variable_product_options' ).find( '.woocommerce_variations' ),
|
||||
need_update = $( '.variation-needs-update', wrapper ),
|
||||
data = {};
|
||||
|
||||
|
@ -486,10 +486,10 @@ jQuery( function( $ ) {
|
|||
$( '#variable_product_options' ).trigger( 'woocommerce_variations_save_variations_button' );
|
||||
|
||||
wc_meta_boxes_product_variations_ajax.save_changes( function( error ) {
|
||||
var wrapper = $( '#variable_product_options .woocommerce_variations' ),
|
||||
var wrapper = $( '#variable_product_options' ).find( '.woocommerce_variations' ),
|
||||
current = wrapper.attr( 'data-page' );
|
||||
|
||||
$( '#variable_product_options #woocommerce_errors' ).remove();
|
||||
$( '#variable_product_options' ).find( '#woocommerce_errors' ).remove();
|
||||
|
||||
if ( error ) {
|
||||
wrapper.before( error );
|
||||
|
@ -520,9 +520,9 @@ jQuery( function( $ ) {
|
|||
* @return {Bool}
|
||||
*/
|
||||
cancel_variations: function() {
|
||||
var current = parseInt( $( '#variable_product_options .woocommerce_variations' ).attr( 'data-page' ), 10 );
|
||||
var current = parseInt( $( '#variable_product_options' ).find( '.woocommerce_variations' ).attr( 'data-page' ), 10 );
|
||||
|
||||
$( '#variable_product_options .woocommerce_variations .variation-needs-update' ).removeClass( 'variation-needs-update' );
|
||||
$( '#variable_product_options' ).find( '.woocommerce_variations .variation-needs-update' ).removeClass( 'variation-needs-update' );
|
||||
$( '.variations-defaults select' ).each( function() {
|
||||
$( this ).val( $( this ).attr( 'data-current' ) );
|
||||
});
|
||||
|
@ -551,7 +551,7 @@ jQuery( function( $ ) {
|
|||
var variation = $( response );
|
||||
variation.addClass( 'variation-needs-update' );
|
||||
|
||||
$( '#variable_product_options .woocommerce_variations' ).prepend( variation );
|
||||
$( '#variable_product_options' ).find( '.woocommerce_variations' ).prepend( variation );
|
||||
$( 'button.cancel-variation-changes, button.save-variation-changes' ).removeAttr( 'disabled' );
|
||||
$( '#variable_product_options' ).trigger( 'woocommerce_variations_added', 1 );
|
||||
wc_meta_boxes_product_variations_ajax.unblock();
|
||||
|
@ -584,7 +584,7 @@ jQuery( function( $ ) {
|
|||
data.security = woocommerce_admin_meta_boxes_variations.delete_variations_nonce;
|
||||
|
||||
$.post( woocommerce_admin_meta_boxes_variations.ajax_url, data, function() {
|
||||
var wrapper = $( '#variable_product_options .woocommerce_variations' ),
|
||||
var wrapper = $( '#variable_product_options' ).find( '.woocommerce_variations' ),
|
||||
current_page = parseInt( wrapper.attr( 'data-page' ), 10 ),
|
||||
total_pages = Math.ceil( ( parseInt( wrapper.attr( 'data-total' ), 10 ) - 1 ) / woocommerce_admin_meta_boxes_variations.variations_per_page ),
|
||||
page = 1;
|
||||
|
@ -695,7 +695,7 @@ jQuery( function( $ ) {
|
|||
if ( window.confirm( woocommerce_admin_meta_boxes_variations.i18n_delete_all_variations ) ) {
|
||||
if ( window.confirm( woocommerce_admin_meta_boxes_variations.i18n_last_warning ) ) {
|
||||
data.allowed = true;
|
||||
changes = parseInt( $( '#variable_product_options .woocommerce_variations' ).attr( 'data-total' ), 10 ) * -1;
|
||||
changes = parseInt( $( '#variable_product_options' ).find( '.woocommerce_variations' ).attr( 'data-total' ), 10 ) * -1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -747,7 +747,7 @@ jQuery( function( $ ) {
|
|||
}
|
||||
|
||||
if ( 'delete_all' === do_variation_action && data.allowed ) {
|
||||
$( '#variable_product_options .variation-needs-update' ).removeClass( 'variation-needs-update' );
|
||||
$( '#variable_product_options' ).find( '.variation-needs-update' ).removeClass( 'variation-needs-update' );
|
||||
} else {
|
||||
wc_meta_boxes_product_variations_ajax.check_for_changes();
|
||||
}
|
||||
|
@ -797,7 +797,7 @@ jQuery( function( $ ) {
|
|||
* @return {Int}
|
||||
*/
|
||||
update_variations_count: function( qty ) {
|
||||
var wrapper = $( '#variable_product_options .woocommerce_variations' ),
|
||||
var wrapper = $( '#variable_product_options' ).find( '.woocommerce_variations' ),
|
||||
total = parseInt( wrapper.attr( 'data-total' ), 10 ) + qty,
|
||||
displaying_num = $( '.variations-pagenav .displaying-num' );
|
||||
|
||||
|
@ -828,7 +828,7 @@ jQuery( function( $ ) {
|
|||
if ( page_nav.is( ':hidden' ) ) {
|
||||
$( 'option, optgroup', '.variation_actions' ).show();
|
||||
$( '.variation_actions' ).val( 'add_variation' );
|
||||
$( '#variable_product_options .toolbar' ).show();
|
||||
$( '#variable_product_options' ).find( '.toolbar' ).show();
|
||||
page_nav.show();
|
||||
$( '.pagination-links', page_nav ).hide();
|
||||
}
|
||||
|
@ -841,9 +841,9 @@ jQuery( function( $ ) {
|
|||
* @param {Int} qty
|
||||
*/
|
||||
set_paginav: function( qty ) {
|
||||
var wrapper = $( '#variable_product_options .woocommerce_variations' ),
|
||||
var wrapper = $( '#variable_product_options' ).find( '.woocommerce_variations' ),
|
||||
new_qty = wc_meta_boxes_product_variations_pagenav.update_variations_count( qty ),
|
||||
toolbar = $( '#variable_product_options .toolbar' ),
|
||||
toolbar = $( '#variable_product_options' ).find( '.toolbar' ),
|
||||
variation_action = $( '.variation_actions' ),
|
||||
page_nav = $( '.variations-pagenav' ),
|
||||
displaying_links = $( '.pagination-links', page_nav ),
|
||||
|
@ -946,7 +946,7 @@ jQuery( function( $ ) {
|
|||
*/
|
||||
page_selector: function() {
|
||||
var selected = parseInt( $( this ).val(), 10 ),
|
||||
wrapper = $( '#variable_product_options .woocommerce_variations' );
|
||||
wrapper = $( '#variable_product_options' ).find( '.woocommerce_variations' );
|
||||
|
||||
$( '.variations-pagenav .page-selector' ).val( selected );
|
||||
|
||||
|
@ -975,7 +975,7 @@ jQuery( function( $ ) {
|
|||
*/
|
||||
prev_page: function() {
|
||||
if ( wc_meta_boxes_product_variations_pagenav.check_is_enabled( this ) ) {
|
||||
var wrapper = $( '#variable_product_options .woocommerce_variations' ),
|
||||
var wrapper = $( '#variable_product_options' ).find( '.woocommerce_variations' ),
|
||||
prev_page = parseInt( wrapper.attr( 'data-page' ), 10 ) - 1,
|
||||
new_page = ( 0 < prev_page ) ? prev_page : 1;
|
||||
|
||||
|
@ -992,7 +992,7 @@ jQuery( function( $ ) {
|
|||
*/
|
||||
next_page: function() {
|
||||
if ( wc_meta_boxes_product_variations_pagenav.check_is_enabled( this ) ) {
|
||||
var wrapper = $( '#variable_product_options .woocommerce_variations' ),
|
||||
var wrapper = $( '#variable_product_options' ).find( '.woocommerce_variations' ),
|
||||
total_pages = parseInt( wrapper.attr( 'data-total_pages' ), 10 ),
|
||||
next_page = parseInt( wrapper.attr( 'data-page' ), 10 ) + 1,
|
||||
new_page = ( total_pages >= next_page ) ? next_page : total_pages;
|
||||
|
@ -1010,7 +1010,7 @@ jQuery( function( $ ) {
|
|||
*/
|
||||
last_page: function() {
|
||||
if ( wc_meta_boxes_product_variations_pagenav.check_is_enabled( this ) ) {
|
||||
var last_page = $( '#variable_product_options .woocommerce_variations' ).attr( 'data-total_pages' );
|
||||
var last_page = $( '#variable_product_options' ).find( '.woocommerce_variations' ).attr( 'data-total_pages' );
|
||||
|
||||
wc_meta_boxes_product_variations_pagenav.set_page( last_page );
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -30,7 +30,7 @@ jQuery( function( $ ) {
|
|||
|
||||
$( function() {
|
||||
// Prevent inputs in meta box headings opening/closing contents
|
||||
$( '#woocommerce-product-data h3.hndle' ).unbind( 'click.postboxes' );
|
||||
$( '#woocommerce-product-data' ).find( 'h3.hndle' ).unbind( 'click.postboxes' );
|
||||
|
||||
jQuery( '#woocommerce-product-data' ).on( 'click', 'h3.hndle', function( event ) {
|
||||
|
||||
|
@ -44,16 +44,16 @@ jQuery( function( $ ) {
|
|||
});
|
||||
|
||||
// Catalog Visibility
|
||||
$( '#catalog-visibility .edit-catalog-visibility' ).click( function () {
|
||||
if ( $( '#catalog-visibility-select').is( ':hidden' ) ) {
|
||||
$( '#catalog-visibility' ).find( '.edit-catalog-visibility' ).click( function () {
|
||||
if ( $( '#catalog-visibility-select' ).is( ':hidden' ) ) {
|
||||
$( '#catalog-visibility-select' ).slideDown( 'fast' );
|
||||
$( this ).hide();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
$('#catalog-visibility .save-post-visibility').click( function () {
|
||||
$('#catalog-visibility-select').slideUp( 'fast' );
|
||||
$('#catalog-visibility .edit-catalog-visibility').show();
|
||||
$( '#catalog-visibility' ).find( '.save-post-visibility' ).click( function () {
|
||||
$( '#catalog-visibility-select' ).slideUp( 'fast' );
|
||||
$( '#catalog-visibility' ).find( '.edit-catalog-visibility' ).show();
|
||||
|
||||
var label = $( 'input[name=_visibility]:checked' ).attr( 'data-label' );
|
||||
|
||||
|
@ -65,9 +65,9 @@ jQuery( function( $ ) {
|
|||
$( '#catalog-visibility-display' ).text( label );
|
||||
return false;
|
||||
});
|
||||
$( '#catalog-visibility .cancel-post-visibility' ).click( function () {
|
||||
$( '#catalog-visibility' ).find( '.cancel-post-visibility' ).click( function () {
|
||||
$( '#catalog-visibility-select' ).slideUp( 'fast' );
|
||||
$( '#catalog-visibility .edit-catalog-visibility' ).show();
|
||||
$( '#catalog-visibility' ).find( '.edit-catalog-visibility' ).show();
|
||||
|
||||
var current_visibility = $( '#current_visibility' ).val();
|
||||
var current_featured = $( '#current_featured' ).val();
|
||||
|
@ -115,7 +115,7 @@ jQuery( function( $ ) {
|
|||
}).change();
|
||||
|
||||
$( document.body ).on( 'woocommerce-product-type-change', function( e, select_val ) {
|
||||
if ( 'variable' !== select_val && 0 < $( '#variable_product_options input[name^=variable_sku]' ).length && $( document.body ).triggerHandler( 'woocommerce-display-product-type-alert', select_val ) !== false ) {
|
||||
if ( 'variable' !== select_val && 0 < $( '#variable_product_options' ).find( 'input[name^=variable_sku]' ).length && $( document.body ).triggerHandler( 'woocommerce-display-product-type-alert', select_val ) !== false ) {
|
||||
window.alert( woocommerce_admin_meta_boxes.i18n_product_type_alert );
|
||||
}
|
||||
});
|
||||
|
@ -514,7 +514,7 @@ jQuery( function( $ ) {
|
|||
// Product gallery file uploads
|
||||
var product_gallery_frame;
|
||||
var $image_gallery_ids = $( '#product_image_gallery' );
|
||||
var $product_images = $( '#product_images_container ul.product_images' );
|
||||
var $product_images = $( '#product_images_container' ).find( 'ul.product_images' );
|
||||
|
||||
jQuery( '.add_product_images' ).on( 'click', 'a', function( event ) {
|
||||
var $el = $( this );
|
||||
|
@ -585,7 +585,7 @@ jQuery( function( $ ) {
|
|||
update: function() {
|
||||
var attachment_ids = '';
|
||||
|
||||
$( '#product_images_container ul li.image' ).css( 'cursor', 'default' ).each( function() {
|
||||
$( '#product_images_container' ).find( 'ul li.image' ).css( 'cursor', 'default' ).each( function() {
|
||||
var attachment_id = jQuery( this ).attr( 'data-attachment_id' );
|
||||
attachment_ids = attachment_ids + attachment_id + ',';
|
||||
});
|
||||
|
@ -600,7 +600,7 @@ jQuery( function( $ ) {
|
|||
|
||||
var attachment_ids = '';
|
||||
|
||||
$( '#product_images_container ul li.image' ).css( 'cursor', 'default' ).each( function() {
|
||||
$( '#product_images_container' ).find( 'ul li.image' ).css( 'cursor', 'default' ).each( function() {
|
||||
var attachment_id = jQuery( this ).attr( 'data-attachment_id' );
|
||||
attachment_ids = attachment_ids + attachment_id + ',';
|
||||
});
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -16,7 +16,7 @@ jQuery( function ( $ ) {
|
|||
runTipTip();
|
||||
|
||||
// Allow Tabbing
|
||||
$( '#titlediv #title' ).keyup( function( event ) {
|
||||
$( '#titlediv' ).find( '#title' ).keyup( function( event ) {
|
||||
var code = event.keyCode || event.which;
|
||||
|
||||
// Tab key
|
||||
|
|
|
@ -1 +1 @@
|
|||
jQuery(function(a){function b(){a("#tiptip_holder").removeAttr("style"),a("#tiptip_arrow").removeAttr("style"),a(".tips").tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50,delay:200})}b(),a("#titlediv #title").keyup(function(b){var c=b.keyCode||b.which;return"9"===c&&a("#woocommerce-coupon-description").size()>0?(b.stopPropagation(),a("#woocommerce-coupon-description").focus(),!1):void 0}),a(".wc-metaboxes-wrapper").on("click",".wc-metabox > h3",function(){a(this).parent(".wc-metabox").toggleClass("closed").toggleClass("open")}),a(document.body).on("wc-init-tabbed-panels",function(){a("ul.wc-tabs").show(),a("ul.wc-tabs a").click(function(){var b=a(this).closest("div.panel-wrap");return a("ul.wc-tabs li",b).removeClass("active"),a(this).parent().addClass("active"),a("div.panel",b).hide(),a(a(this).attr("href")).show(),!1}),a("div.panel-wrap").each(function(){a(this).find("ul.wc-tabs li").eq(0).find("a").click()})}).trigger("wc-init-tabbed-panels"),a(document.body).on("wc-init-datepickers",function(){a(".date-picker-field, .date-picker").datepicker({dateFormat:"yy-mm-dd",numberOfMonths:1,showButtonPanel:!0})}).trigger("wc-init-datepickers"),a(".wc-metaboxes-wrapper").on("click",".wc-metabox h3",function(b){a(b.target).filter(":input, option, .sort").length||a(this).next(".wc-metabox-content").stop().slideToggle()}).on("click",".expand_all",function(){return a(this).closest(".wc-metaboxes-wrapper").find(".wc-metabox > .wc-metabox-content").show(),!1}).on("click",".close_all",function(){return a(this).closest(".wc-metaboxes-wrapper").find(".wc-metabox > .wc-metabox-content").hide(),!1}),a(".wc-metabox.closed").each(function(){a(this).find(".wc-metabox-content").hide()})});
|
||||
jQuery(function(a){function b(){a("#tiptip_holder").removeAttr("style"),a("#tiptip_arrow").removeAttr("style"),a(".tips").tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50,delay:200})}b(),a("#titlediv").find("#title").keyup(function(b){var c=b.keyCode||b.which;return"9"===c&&a("#woocommerce-coupon-description").size()>0?(b.stopPropagation(),a("#woocommerce-coupon-description").focus(),!1):void 0}),a(".wc-metaboxes-wrapper").on("click",".wc-metabox > h3",function(){a(this).parent(".wc-metabox").toggleClass("closed").toggleClass("open")}),a(document.body).on("wc-init-tabbed-panels",function(){a("ul.wc-tabs").show(),a("ul.wc-tabs a").click(function(){var b=a(this).closest("div.panel-wrap");return a("ul.wc-tabs li",b).removeClass("active"),a(this).parent().addClass("active"),a("div.panel",b).hide(),a(a(this).attr("href")).show(),!1}),a("div.panel-wrap").each(function(){a(this).find("ul.wc-tabs li").eq(0).find("a").click()})}).trigger("wc-init-tabbed-panels"),a(document.body).on("wc-init-datepickers",function(){a(".date-picker-field, .date-picker").datepicker({dateFormat:"yy-mm-dd",numberOfMonths:1,showButtonPanel:!0})}).trigger("wc-init-datepickers"),a(".wc-metaboxes-wrapper").on("click",".wc-metabox h3",function(b){a(b.target).filter(":input, option, .sort").length||a(this).next(".wc-metabox-content").stop().slideToggle()}).on("click",".expand_all",function(){return a(this).closest(".wc-metaboxes-wrapper").find(".wc-metabox > .wc-metabox-content").show(),!1}).on("click",".close_all",function(){return a(this).closest(".wc-metaboxes-wrapper").find(".wc-metabox > .wc-metabox-content").hide(),!1}),a(".wc-metabox.closed").each(function(){a(this).find(".wc-metabox-content").hide()})});
|
|
@ -100,8 +100,8 @@ jQuery(function( $ ) {
|
|||
|
||||
$( '#wpbody' ).on( 'click', '#doaction, #doaction2', function() {
|
||||
$( 'input.text', '.inline-edit-row' ).val( '' );
|
||||
$( '#woocommerce-fields select' ).prop( 'selectedIndex', 0 );
|
||||
$( '#woocommerce-fields-bulk .inline-edit-group .change-input' ).hide();
|
||||
$( '#woocommerce-fields' ).find( 'select' ).prop( 'selectedIndex', 0 );
|
||||
$( '#woocommerce-fields-bulk' ).find( '.inline-edit-group .change-input' ).hide();
|
||||
|
||||
// Autosuggest product tags on bulk edit
|
||||
var tax = 'product_tag';
|
||||
|
|
|
@ -1 +1 @@
|
|||
jQuery(function(a){a("#the-list").on("click",".editinline",function(){inlineEditPost.revert();var b=a(this).closest("tr").attr("id");b=b.replace("post-","");var c=a("#woocommerce_inline_"+b),d=c.find(".sku").text(),e=c.find(".regular_price").text(),f=c.find(".sale_price ").text(),g=c.find(".weight").text(),h=c.find(".length").text(),i=c.find(".width").text(),j=c.find(".height").text(),k=c.find(".shipping_class").text(),l=c.find(".visibility").text(),m=c.find(".stock_status").text(),n=c.find(".stock").text(),o=c.find(".featured").text(),p=c.find(".manage_stock").text(),q=c.find(".menu_order").text(),r=c.find(".tax_status").text(),s=c.find(".tax_class").text(),t=c.find(".backorders").text();a('input[name="_sku"]',".inline-edit-row").val(d),a('input[name="_regular_price"]',".inline-edit-row").val(e),a('input[name="_sale_price"]',".inline-edit-row").val(f),a('input[name="_weight"]',".inline-edit-row").val(g),a('input[name="_length"]',".inline-edit-row").val(h),a('input[name="_width"]',".inline-edit-row").val(i),a('input[name="_height"]',".inline-edit-row").val(j),a('select[name="_shipping_class"] option:selected',".inline-edit-row").attr("selected",!1).change(),a('select[name="_shipping_class"] option[value="'+k+'"]').attr("selected","selected").change(),a('input[name="_stock"]',".inline-edit-row").val(n),a('input[name="menu_order"]',".inline-edit-row").val(q),a('select[name="_tax_status"] option[value="'+r+'"]',".inline-edit-row").attr("selected","selected"),a('select[name="_tax_class"] option[value="'+s+'"]',".inline-edit-row").attr("selected","selected"),a('select[name="_visibility"] option, select[name="_stock_status"] option, select[name="_backorders"] option').removeAttr("selected"),a('select[name="_visibility"] option[value="'+l+'"]',".inline-edit-row").attr("selected","selected"),a('select[name="_stock_status"] option[value="'+m+'"]',".inline-edit-row").attr("selected","selected"),a('select[name="_backorders"] option[value="'+t+'"]',".inline-edit-row").attr("selected","selected"),"yes"===o?a('input[name="_featured"]',".inline-edit-row").attr("checked","checked"):a('input[name="_featured"]',".inline-edit-row").removeAttr("checked"),"yes"===p?(a(".stock_qty_field",".inline-edit-row").show().removeAttr("style"),a('input[name="_manage_stock"]',".inline-edit-row").attr("checked","checked")):(a(".stock_qty_field",".inline-edit-row").hide(),a('input[name="_manage_stock"]',".inline-edit-row").removeAttr("checked"));var u=c.find(".product_type").text(),v=c.find(".product_is_virtual").text();"simple"===u||"external"===u?a(".price_fields",".inline-edit-row").show().removeAttr("style"):a(".price_fields",".inline-edit-row").hide(),"yes"===v?a(".dimension_fields",".inline-edit-row").hide():a(".dimension_fields",".inline-edit-row").show().removeAttr("style"),"grouped"===u?a(".stock_fields",".inline-edit-row").hide():a(".stock_fields",".inline-edit-row").show().removeAttr("style")}),a("#the-list").on("change",'.inline-edit-row input[name="_manage_stock"]',function(){a(this).is(":checked")?a(".stock_qty_field",".inline-edit-row").show().removeAttr("style"):a(".stock_qty_field",".inline-edit-row").hide()}),a("#wpbody").on("click","#doaction, #doaction2",function(){a("input.text",".inline-edit-row").val(""),a("#woocommerce-fields select").prop("selectedIndex",0),a("#woocommerce-fields-bulk .inline-edit-group .change-input").hide();var b="product_tag";a('tr.inline-editor textarea[name="tax_input['+b+']"]').suggest(ajaxurl+"?action=ajax-tag-search&tax="+b,{delay:500,minchars:2,multiple:!0,multipleSep:inlineEditL10n.comma})}),a("#wpbody").on("change","#woocommerce-fields-bulk .inline-edit-group .change_to",function(){0<a(this).val()?a(this).closest("div").find(".change-input").show():a(this).closest("div").find(".change-input").hide()})});
|
||||
jQuery(function(a){a("#the-list").on("click",".editinline",function(){inlineEditPost.revert();var b=a(this).closest("tr").attr("id");b=b.replace("post-","");var c=a("#woocommerce_inline_"+b),d=c.find(".sku").text(),e=c.find(".regular_price").text(),f=c.find(".sale_price ").text(),g=c.find(".weight").text(),h=c.find(".length").text(),i=c.find(".width").text(),j=c.find(".height").text(),k=c.find(".shipping_class").text(),l=c.find(".visibility").text(),m=c.find(".stock_status").text(),n=c.find(".stock").text(),o=c.find(".featured").text(),p=c.find(".manage_stock").text(),q=c.find(".menu_order").text(),r=c.find(".tax_status").text(),s=c.find(".tax_class").text(),t=c.find(".backorders").text();a('input[name="_sku"]',".inline-edit-row").val(d),a('input[name="_regular_price"]',".inline-edit-row").val(e),a('input[name="_sale_price"]',".inline-edit-row").val(f),a('input[name="_weight"]',".inline-edit-row").val(g),a('input[name="_length"]',".inline-edit-row").val(h),a('input[name="_width"]',".inline-edit-row").val(i),a('input[name="_height"]',".inline-edit-row").val(j),a('select[name="_shipping_class"] option:selected',".inline-edit-row").attr("selected",!1).change(),a('select[name="_shipping_class"] option[value="'+k+'"]').attr("selected","selected").change(),a('input[name="_stock"]',".inline-edit-row").val(n),a('input[name="menu_order"]',".inline-edit-row").val(q),a('select[name="_tax_status"] option[value="'+r+'"]',".inline-edit-row").attr("selected","selected"),a('select[name="_tax_class"] option[value="'+s+'"]',".inline-edit-row").attr("selected","selected"),a('select[name="_visibility"] option, select[name="_stock_status"] option, select[name="_backorders"] option').removeAttr("selected"),a('select[name="_visibility"] option[value="'+l+'"]',".inline-edit-row").attr("selected","selected"),a('select[name="_stock_status"] option[value="'+m+'"]',".inline-edit-row").attr("selected","selected"),a('select[name="_backorders"] option[value="'+t+'"]',".inline-edit-row").attr("selected","selected"),"yes"===o?a('input[name="_featured"]',".inline-edit-row").attr("checked","checked"):a('input[name="_featured"]',".inline-edit-row").removeAttr("checked"),"yes"===p?(a(".stock_qty_field",".inline-edit-row").show().removeAttr("style"),a('input[name="_manage_stock"]',".inline-edit-row").attr("checked","checked")):(a(".stock_qty_field",".inline-edit-row").hide(),a('input[name="_manage_stock"]',".inline-edit-row").removeAttr("checked"));var u=c.find(".product_type").text(),v=c.find(".product_is_virtual").text();"simple"===u||"external"===u?a(".price_fields",".inline-edit-row").show().removeAttr("style"):a(".price_fields",".inline-edit-row").hide(),"yes"===v?a(".dimension_fields",".inline-edit-row").hide():a(".dimension_fields",".inline-edit-row").show().removeAttr("style"),"grouped"===u?a(".stock_fields",".inline-edit-row").hide():a(".stock_fields",".inline-edit-row").show().removeAttr("style")}),a("#the-list").on("change",'.inline-edit-row input[name="_manage_stock"]',function(){a(this).is(":checked")?a(".stock_qty_field",".inline-edit-row").show().removeAttr("style"):a(".stock_qty_field",".inline-edit-row").hide()}),a("#wpbody").on("click","#doaction, #doaction2",function(){a("input.text",".inline-edit-row").val(""),a("#woocommerce-fields").find("select").prop("selectedIndex",0),a("#woocommerce-fields-bulk").find(".inline-edit-group .change-input").hide();var b="product_tag";a('tr.inline-editor textarea[name="tax_input['+b+']"]').suggest(ajaxurl+"?action=ajax-tag-search&tax="+b,{delay:500,minchars:2,multiple:!0,multipleSep:inlineEditL10n.comma})}),a("#wpbody").on("change","#woocommerce-fields-bulk .inline-edit-group .change_to",function(){0<a(this).val()?a(this).closest("div").find(".change-input").show():a(this).closest("div").find(".change-input").hide()})});
|
|
@ -182,7 +182,7 @@ jQuery( function( $ ) {
|
|||
shipping_methods[ $( this ).data( 'index' ) ] = $( this ).val();
|
||||
} );
|
||||
|
||||
var payment_method = $( '#order_review input[name=payment_method]:checked' ).val(),
|
||||
var payment_method = $( '#order_review' ).find( 'input[name=payment_method]:checked' ).val(),
|
||||
country = $( '#billing_country' ).val(),
|
||||
state = $( '#billing_state' ).val(),
|
||||
postcode = $( 'input#billing_postcode' ).val(),
|
||||
|
@ -196,7 +196,7 @@ jQuery( function( $ ) {
|
|||
s_address,
|
||||
s_address_2;
|
||||
|
||||
if ( $( '#ship-to-different-address input' ).is( ':checked' ) ) {
|
||||
if ( $( '#ship-to-different-address' ).find( 'input' ).is( ':checked' ) ) {
|
||||
s_country = $( '#shipping_country' ).val();
|
||||
s_state = $( '#shipping_state' ).val();
|
||||
s_postcode = $( 'input#shipping_postcode' ).val();
|
||||
|
@ -302,7 +302,7 @@ jQuery( function( $ ) {
|
|||
}
|
||||
|
||||
// Trigger a handler to let gateways manipulate the checkout if needed
|
||||
if ( $form.triggerHandler( 'checkout_place_order' ) !== false && $form.triggerHandler( 'checkout_place_order_' + $( '#order_review input[name=payment_method]:checked' ).val() ) !== false ) {
|
||||
if ( $form.triggerHandler( 'checkout_place_order' ) !== false && $form.triggerHandler( 'checkout_place_order_' + $( '#order_review' ).find( 'input[name=payment_method]:checked' ).val() ) !== false ) {
|
||||
|
||||
$form.addClass( 'processing' );
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -140,7 +140,7 @@ class WC_Admin_Taxonomies {
|
|||
var attachment = file_frame.state().get( 'selection' ).first().toJSON();
|
||||
|
||||
jQuery( '#product_cat_thumbnail_id' ).val( attachment.id );
|
||||
jQuery( '#product_cat_thumbnail img' ).attr( 'src', attachment.sizes.thumbnail.url );
|
||||
jQuery( '#product_cat_thumbnail' ).find( 'img' ).attr( 'src', attachment.sizes.thumbnail.url );
|
||||
jQuery( '.remove_image_button' ).show();
|
||||
});
|
||||
|
||||
|
@ -149,7 +149,7 @@ class WC_Admin_Taxonomies {
|
|||
});
|
||||
|
||||
jQuery( document ).on( 'click', '.remove_image_button', function() {
|
||||
jQuery( '#product_cat_thumbnail img' ).attr( 'src', '<?php echo esc_js( wc_placeholder_img_src() ); ?>' );
|
||||
jQuery( '#product_cat_thumbnail' ).find( 'img' ).attr( 'src', '<?php echo esc_js( wc_placeholder_img_src() ); ?>' );
|
||||
jQuery( '#product_cat_thumbnail_id' ).val( '' );
|
||||
jQuery( '.remove_image_button' ).hide();
|
||||
return false;
|
||||
|
@ -231,7 +231,7 @@ class WC_Admin_Taxonomies {
|
|||
var attachment = file_frame.state().get( 'selection' ).first().toJSON();
|
||||
|
||||
jQuery( '#product_cat_thumbnail_id' ).val( attachment.id );
|
||||
jQuery( '#product_cat_thumbnail img' ).attr( 'src', attachment.sizes.thumbnail.url );
|
||||
jQuery( '#product_cat_thumbnail' ).find( 'img' ).attr( 'src', attachment.sizes.thumbnail.url );
|
||||
jQuery( '.remove_image_button' ).show();
|
||||
});
|
||||
|
||||
|
@ -240,7 +240,7 @@ class WC_Admin_Taxonomies {
|
|||
});
|
||||
|
||||
jQuery( document ).on( 'click', '.remove_image_button', function() {
|
||||
jQuery( '#product_cat_thumbnail img' ).attr( 'src', '<?php echo esc_js( wc_placeholder_img_src() ); ?>' );
|
||||
jQuery( '#product_cat_thumbnail' ).find( 'img' ).attr( 'src', '<?php echo esc_js( wc_placeholder_img_src() ); ?>' );
|
||||
jQuery( '#product_cat_thumbnail_id' ).val( '' );
|
||||
jQuery( '.remove_image_button' ).hide();
|
||||
return false;
|
||||
|
|
|
@ -158,7 +158,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
__( 'Tax Class', 'woocommerce' ),
|
||||
) ) ); ?>\n";
|
||||
|
||||
jQuery('#rates tr:visible').each(function() {
|
||||
jQuery('#rates').find('tr:visible').each(function() {
|
||||
var row = '';
|
||||
jQuery(this).find('td:not(.sort) input').each(function() {
|
||||
|
||||
|
|
|
@ -167,10 +167,10 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
|
||||
<script type="text/javascript">
|
||||
jQuery( function ( $ ) {
|
||||
$( '#webhook-options #webhook_topic' ).on( 'change', function() {
|
||||
$( '#webhook-options' ).find( '#webhook_topic' ).on( 'change', function() {
|
||||
var current = $( this ).val(),
|
||||
action_event_field = $( '#webhook-options #webhook-action-event-wrap' ),
|
||||
custom_topic_field = $( '#webhook-options #webhook-custom-topic-wrap' );
|
||||
action_event_field = $( '#webhook-options' ).find( '#webhook-action-event-wrap' ),
|
||||
custom_topic_field = $( '#webhook-options' ).find( '#webhook-custom-topic-wrap' );
|
||||
|
||||
action_event_field.hide();
|
||||
custom_topic_field.hide();
|
||||
|
|
|
@ -776,7 +776,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
|
||||
try {
|
||||
jQuery( '#debug-report' ).slideDown();
|
||||
jQuery( '#debug-report textarea' ).val( report ).focus().select();
|
||||
jQuery( '#debug-report' ).find( 'textarea' ).val( report ).focus().select();
|
||||
jQuery( this ).fadeOut();
|
||||
return false;
|
||||
} catch( e ){
|
||||
|
@ -797,7 +797,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
|
||||
$( document.body ).on( 'copy', '#copy-for-support', function( e ) {
|
||||
e.clipboardData.clearData();
|
||||
e.clipboardData.setData( 'text/plain', $( '#debug-report textarea' ).val() );
|
||||
e.clipboardData.setData( 'text/plain', $( '#debug-report' ).find( 'textarea' ).val() );
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
|
|
|
@ -163,7 +163,7 @@ class WC_Gateway_BACS extends WC_Payment_Gateway {
|
|||
jQuery(function() {
|
||||
jQuery('#bacs_accounts').on( 'click', 'a.add', function(){
|
||||
|
||||
var size = jQuery('#bacs_accounts tbody .account').size();
|
||||
var size = jQuery('#bacs_accounts').find('tbody .account').size();
|
||||
|
||||
jQuery('<tr class="account">\
|
||||
<td class="sort"></td>\
|
||||
|
|
Loading…
Reference in New Issue