Added namespace to jQuery events that are removed in creation of a VariationForm.

This commit is contained in:
Trey Richards 2017-05-09 16:50:34 -07:00
parent 43c8efd346
commit 9774cfa15f
2 changed files with 7 additions and 9 deletions

View File

@ -16,9 +16,7 @@
// Initial state.
this.$singleVariationWrap.show();
this.$form.unbind( 'check_variations update_variation_values found_variation' );
this.$resetVariations.unbind( 'click' );
this.$attributeFields.unbind( 'change ' );
this.$form.off( '.wc-variation-form' );
// Methods.
this.getChosenAttributes = this.getChosenAttributes.bind( this );
@ -27,17 +25,17 @@
this.toggleResetLink = this.toggleResetLink.bind( this );
// Events.
$form.on( 'click', '.reset_variations', { variationForm: this }, this.onReset );
$form.on( 'click.wc-variation-form', '.reset_variations', { variationForm: this }, this.onReset );
$form.on( 'reload_product_variations', { variationForm: this }, this.onReload );
$form.on( 'hide_variation', { variationForm: this }, this.onHide );
$form.on( 'show_variation', { variationForm: this }, this.onShow );
$form.on( 'click', '.single_add_to_cart_button', { variationForm: this }, this.onAddToCart );
$form.on( 'reset_data', { variationForm: this }, this.onResetDisplayedVariation );
$form.on( 'reset_image', { variationForm: this }, this.onResetImage );
$form.on( 'change', '.variations select', { variationForm: this }, this.onChange );
$form.on( 'found_variation', { variationForm: this }, this.onFoundVariation );
$form.on( 'check_variations', { variationForm: this }, this.onFindVariation );
$form.on( 'update_variation_values', { variationForm: this }, this.onUpdateAttributes );
$form.on( 'change.wc-variation-form', '.variations select', { variationForm: this }, this.onChange );
$form.on( 'found_variation.wc-variation-form', { variationForm: this }, this.onFoundVariation );
$form.on( 'check_variations.wc-variation-form', { variationForm: this }, this.onFindVariation );
$form.on( 'update_variation_values.wc-variation-form', { variationForm: this }, this.onUpdateAttributes );
// Check variations once init.
$form.trigger( 'check_variations' );

File diff suppressed because one or more lines are too long