Revert "replace jQuery..bind except in 3rd party assets"
This reverts commit 61c4e20863
.
This commit is contained in:
parent
489d8042d0
commit
e6f620d156
|
@ -346,7 +346,7 @@ jQuery( function( $ ) {
|
||||||
|
|
||||||
postForm.on( 'submit', this.save_on_submit );
|
postForm.on( 'submit', this.save_on_submit );
|
||||||
|
|
||||||
$( 'input:submit', postForm ).on( 'click keypress', function() {
|
$( 'input:submit', postForm ).bind( 'click keypress', function() {
|
||||||
postForm.data( 'callerid', this.id );
|
postForm.data( 'callerid', this.id );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ jQuery( function( $ ) {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Prevent enter submitting post form.
|
// Prevent enter submitting post form.
|
||||||
$( '#upsell_product_data' ).on( 'keypress', function( e ) {
|
$( '#upsell_product_data' ).bind( 'keypress', function( e ) {
|
||||||
if ( e.keyCode === 13 ) {
|
if ( e.keyCode === 13 ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ jQuery(function( $ ) {
|
||||||
var prev_data_index = null;
|
var prev_data_index = null;
|
||||||
var prev_series_index = null;
|
var prev_series_index = null;
|
||||||
|
|
||||||
$( '.chart-placeholder' ).on( 'plothover', function ( event, pos, item ) {
|
$( '.chart-placeholder' ).bind( 'plothover', function ( event, pos, item ) {
|
||||||
if ( item ) {
|
if ( item ) {
|
||||||
if ( prev_data_index !== item.dataIndex || prev_series_index !== item.seriesIndex ) {
|
if ( prev_data_index !== item.dataIndex || prev_series_index !== item.seriesIndex ) {
|
||||||
prev_data_index = item.dataIndex;
|
prev_data_index = item.dataIndex;
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
this.$form.find('.woocommerce-exporter-progress').val( 0 );
|
this.$form.find('.woocommerce-exporter-progress').val( 0 );
|
||||||
|
|
||||||
// Methods.
|
// Methods.
|
||||||
this.processStep = this.processStep.on( this );
|
this.processStep = this.processStep.bind( this );
|
||||||
|
|
||||||
// Events.
|
// Events.
|
||||||
$form.on( 'submit', { productExportForm: this }, this.onSubmit );
|
$form.on( 'submit', { productExportForm: this }, this.onSubmit );
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
// Initial state.
|
// Initial state.
|
||||||
this.$form.find('.woocommerce-importer-progress').val( 0 );
|
this.$form.find('.woocommerce-importer-progress').val( 0 );
|
||||||
|
|
||||||
this.run_import = this.run_import.on( this );
|
this.run_import = this.run_import.bind( this );
|
||||||
|
|
||||||
// Start importing.
|
// Start importing.
|
||||||
this.run_import();
|
this.run_import();
|
||||||
|
|
|
@ -252,7 +252,7 @@ jQuery( function( $ ) {
|
||||||
bySlug[ slug ].find( 'a' )
|
bySlug[ slug ].find( 'a' )
|
||||||
.on( 'mouseenter mouseleave', ( function( $hover, event ) {
|
.on( 'mouseenter mouseleave', ( function( $hover, event ) {
|
||||||
$hover.toggleClass( 'plugin-install-source', 'mouseenter' === event.type );
|
$hover.toggleClass( 'plugin-install-source', 'mouseenter' === event.type );
|
||||||
} ).on( null, hover ? $el.closest( hover ) : $el ) );
|
} ).bind( null, hover ? $el.closest( hover ) : $el ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -250,7 +250,7 @@
|
||||||
var shifted = false;
|
var shifted = false;
|
||||||
var hasFocus = false;
|
var hasFocus = false;
|
||||||
|
|
||||||
$( document.body ).on( 'keyup keydown', function( e ) {
|
$( document.body ).bind( 'keyup keydown', function( e ) {
|
||||||
shifted = e.shiftKey;
|
shifted = e.shiftKey;
|
||||||
controlled = e.ctrlKey || e.metaKey;
|
controlled = e.ctrlKey || e.metaKey;
|
||||||
});
|
});
|
||||||
|
|
|
@ -22,10 +22,10 @@
|
||||||
self.$form.off( '.wc-variation-form' );
|
self.$form.off( '.wc-variation-form' );
|
||||||
|
|
||||||
// Methods.
|
// Methods.
|
||||||
self.getChosenAttributes = self.getChosenAttributes.on( self );
|
self.getChosenAttributes = self.getChosenAttributes.bind( self );
|
||||||
self.findMatchingVariations = self.findMatchingVariations.on( self );
|
self.findMatchingVariations = self.findMatchingVariations.bind( self );
|
||||||
self.isMatch = self.isMatch.on( self );
|
self.isMatch = self.isMatch.bind( self );
|
||||||
self.toggleResetLink = self.toggleResetLink.on( self );
|
self.toggleResetLink = self.toggleResetLink.bind( self );
|
||||||
|
|
||||||
// Events.
|
// Events.
|
||||||
$form.on( 'click.wc-variation-form', '.reset_variations', { variationForm: self }, self.onReset );
|
$form.on( 'click.wc-variation-form', '.reset_variations', { variationForm: self }, self.onReset );
|
||||||
|
|
|
@ -10,8 +10,8 @@ jQuery( function( $ ) {
|
||||||
*/
|
*/
|
||||||
var AddToCartHandler = function() {
|
var AddToCartHandler = function() {
|
||||||
this.requests = [];
|
this.requests = [];
|
||||||
this.addRequest = this.addRequest.on( this );
|
this.addRequest = this.addRequest.bind( this );
|
||||||
this.run = this.run.on( this );
|
this.run = this.run.bind( this );
|
||||||
|
|
||||||
$( document.body )
|
$( document.body )
|
||||||
.on( 'click', '.add_to_cart_button', { addToCartHandler: this }, this.onAddToCart )
|
.on( 'click', '.add_to_cart_button', { addToCartHandler: this }, this.onAddToCart )
|
||||||
|
|
|
@ -32,7 +32,7 @@ jQuery( function( $ ) {
|
||||||
|
|
||||||
// Handle locale
|
// Handle locale
|
||||||
$( document.body )
|
$( document.body )
|
||||||
.on( 'country_to_state_changing', function( event, country, wrapper ) {
|
.bind( 'country_to_state_changing', function( event, country, wrapper ) {
|
||||||
var thisform = wrapper, thislocale;
|
var thisform = wrapper, thislocale;
|
||||||
|
|
||||||
if ( typeof locale[ country ] !== 'undefined' ) {
|
if ( typeof locale[ country ] !== 'undefined' ) {
|
||||||
|
|
|
@ -180,7 +180,7 @@ jQuery( function( $ ) {
|
||||||
wp.customize.widgetsPreview.WidgetPartial
|
wp.customize.widgetsPreview.WidgetPartial
|
||||||
);
|
);
|
||||||
if ( hasSelectiveRefresh ) {
|
if ( hasSelectiveRefresh ) {
|
||||||
wp.customize.selectiveRefresh.on( 'partial-content-rendered', function() {
|
wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function() {
|
||||||
refresh_cart_fragment();
|
refresh_cart_fragment();
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,9 +152,9 @@ jQuery( function( $ ) {
|
||||||
*/
|
*/
|
||||||
init: function( cart ) {
|
init: function( cart ) {
|
||||||
this.cart = cart;
|
this.cart = cart;
|
||||||
this.toggle_shipping = this.toggle_shipping.on( this );
|
this.toggle_shipping = this.toggle_shipping.bind( this );
|
||||||
this.shipping_method_selected = this.shipping_method_selected.on( this );
|
this.shipping_method_selected = this.shipping_method_selected.bind( this );
|
||||||
this.shipping_calculator_submit = this.shipping_calculator_submit.on( this );
|
this.shipping_calculator_submit = this.shipping_calculator_submit.bind( this );
|
||||||
|
|
||||||
$( document ).on(
|
$( document ).on(
|
||||||
'click',
|
'click',
|
||||||
|
@ -261,16 +261,16 @@ jQuery( function( $ ) {
|
||||||
* Initialize cart UI events.
|
* Initialize cart UI events.
|
||||||
*/
|
*/
|
||||||
init: function() {
|
init: function() {
|
||||||
this.update_cart_totals = this.update_cart_totals.on( this );
|
this.update_cart_totals = this.update_cart_totals.bind( this );
|
||||||
this.input_keypress = this.input_keypress.on( this );
|
this.input_keypress = this.input_keypress.bind( this );
|
||||||
this.cart_submit = this.cart_submit.on( this );
|
this.cart_submit = this.cart_submit.bind( this );
|
||||||
this.submit_click = this.submit_click.on( this );
|
this.submit_click = this.submit_click.bind( this );
|
||||||
this.apply_coupon = this.apply_coupon.on( this );
|
this.apply_coupon = this.apply_coupon.bind( this );
|
||||||
this.remove_coupon_clicked = this.remove_coupon_clicked.on( this );
|
this.remove_coupon_clicked = this.remove_coupon_clicked.bind( this );
|
||||||
this.quantity_update = this.quantity_update.on( this );
|
this.quantity_update = this.quantity_update.bind( this );
|
||||||
this.item_remove_clicked = this.item_remove_clicked.on( this );
|
this.item_remove_clicked = this.item_remove_clicked.bind( this );
|
||||||
this.item_restore_clicked = this.item_restore_clicked.on( this );
|
this.item_restore_clicked = this.item_restore_clicked.bind( this );
|
||||||
this.update_cart = this.update_cart.on( this );
|
this.update_cart = this.update_cart.bind( this );
|
||||||
|
|
||||||
$( document ).on(
|
$( document ).on(
|
||||||
'wc_update_cart added_to_cart',
|
'wc_update_cart added_to_cart',
|
||||||
|
|
|
@ -16,8 +16,8 @@ jQuery( function( $ ) {
|
||||||
$order_review: $( '#order_review' ),
|
$order_review: $( '#order_review' ),
|
||||||
$checkout_form: $( 'form.checkout' ),
|
$checkout_form: $( 'form.checkout' ),
|
||||||
init: function() {
|
init: function() {
|
||||||
$( document.body ).on( 'update_checkout', this.update_checkout );
|
$( document.body ).bind( 'update_checkout', this.update_checkout );
|
||||||
$( document.body ).on( 'init_checkout', this.init_checkout );
|
$( document.body ).bind( 'init_checkout', this.init_checkout );
|
||||||
|
|
||||||
// Payment methods
|
// Payment methods
|
||||||
this.$checkout_form.on( 'click', 'input[name="payment_method"]', this.payment_method_selected );
|
this.$checkout_form.on( 'click', 'input[name="payment_method"]', this.payment_method_selected );
|
||||||
|
|
|
@ -70,7 +70,7 @@ jQuery( function( $ ) {
|
||||||
|
|
||||||
wc_country_select_select2();
|
wc_country_select_select2();
|
||||||
|
|
||||||
$( document.body ).on( 'country_to_state_changed', function() {
|
$( document.body ).bind( 'country_to_state_changed', function() {
|
||||||
wc_country_select_select2();
|
wc_country_select_select2();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,13 +118,13 @@ jQuery( function( $ ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bind functions to this.
|
// Bind functions to this.
|
||||||
this.initFlexslider = this.initFlexslider.on( this );
|
this.initFlexslider = this.initFlexslider.bind( this );
|
||||||
this.initZoom = this.initZoom.on( this );
|
this.initZoom = this.initZoom.bind( this );
|
||||||
this.initZoomForTarget = this.initZoomForTarget.on( this );
|
this.initZoomForTarget = this.initZoomForTarget.bind( this );
|
||||||
this.initPhotoswipe = this.initPhotoswipe.on( this );
|
this.initPhotoswipe = this.initPhotoswipe.bind( this );
|
||||||
this.onResetSlidePosition = this.onResetSlidePosition.on( this );
|
this.onResetSlidePosition = this.onResetSlidePosition.bind( this );
|
||||||
this.getGalleryItems = this.getGalleryItems.on( this );
|
this.getGalleryItems = this.getGalleryItems.bind( this );
|
||||||
this.openPhotoswipe = this.openPhotoswipe.on( this );
|
this.openPhotoswipe = this.openPhotoswipe.bind( this );
|
||||||
|
|
||||||
if ( this.flexslider_enabled ) {
|
if ( this.flexslider_enabled ) {
|
||||||
this.initFlexslider( args.flexslider );
|
this.initFlexslider( args.flexslider );
|
||||||
|
|
|
@ -15,11 +15,11 @@ jQuery( function( $ ) {
|
||||||
}, wc_tokenization_form_params );
|
}, wc_tokenization_form_params );
|
||||||
|
|
||||||
// Bind functions to this.
|
// Bind functions to this.
|
||||||
this.onDisplay = this.onDisplay.on( this );
|
this.onDisplay = this.onDisplay.bind( this );
|
||||||
this.hideForm = this.hideForm.on( this );
|
this.hideForm = this.hideForm.bind( this );
|
||||||
this.showForm = this.showForm.on( this );
|
this.showForm = this.showForm.bind( this );
|
||||||
this.showSaveNewCheckbox = this.showSaveNewCheckbox.on( this );
|
this.showSaveNewCheckbox = this.showSaveNewCheckbox.bind( this );
|
||||||
this.hideSaveNewCheckbox = this.hideSaveNewCheckbox.on( this );
|
this.hideSaveNewCheckbox = this.hideSaveNewCheckbox.bind( this );
|
||||||
|
|
||||||
// When a radio button is changed, make sure to show/hide our new CC info area.
|
// When a radio button is changed, make sure to show/hide our new CC info area.
|
||||||
this.$target.on(
|
this.$target.on(
|
||||||
|
|
Loading…
Reference in New Issue