Skip to content

Commit 3451f65

Browse files
authored
Merge pull request #121 from Yoast/stories/inverted-listeners-regression
Fix inverted listeners
2 parents 8f27855 + 49ac2dc commit 3451f65

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

js/src/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ App.prototype.acf5Listener = function() {
5858

5959
App.prototype.bindListeners = function() {
6060
if ( helper.acf_version >= 5 ) {
61-
jQuery( this.acf4Listener.bind( this ) );
61+
jQuery( this.acf5Listener.bind( this ) );
6262
} else {
6363
var fieldSelectors = config.fieldSelectors.slice( 0 );
6464
var wysiwygSelector = "textarea[id^=wysiwyg-acf]";
6565

6666
// Ignore Wysiwyg fields because they trigger a refresh in Yoast SEO itself
6767
var fieldSelectorsWithoutWysiwyg = _.without( fieldSelectors, wysiwygSelector );
6868

69-
jQuery( document ).on( "acf/setup_fields", this.acf5Listener.bind( this, fieldSelectors, wysiwygSelector, fieldSelectorsWithoutWysiwyg ) );
69+
jQuery( document ).on( "acf/setup_fields", this.acf4Listener.bind( this, fieldSelectors, wysiwygSelector, fieldSelectorsWithoutWysiwyg ) );
7070
}
7171
};
7272

js/yoast-acf-analysis.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ App.prototype.acf5Listener = function() {
5959

6060
App.prototype.bindListeners = function() {
6161
if( helper.acf_version >= 5 ) {
62-
jQuery( this.acf4Listener.bind( this ) );
62+
jQuery( this.acf5Listener.bind( this ) );
6363
}else{
6464
var fieldSelectors = config.fieldSelectors.slice( 0 );
6565
var wysiwygSelector = "textarea[id^=wysiwyg-acf]";
6666

6767
// Ignore Wysiwyg fields because they trigger a refresh in Yoast SEO itself
6868
var fieldSelectorsWithoutWysiwyg = _.without( fieldSelectors, wysiwygSelector );
6969

70-
jQuery( document ).on( "acf/setup_fields", this.acf5Listener.bind( this, fieldSelectors, wysiwygSelector, fieldSelectorsWithoutWysiwyg ) );
70+
jQuery( document ).on( "acf/setup_fields", this.acf4Listener.bind( this, fieldSelectors, wysiwygSelector, fieldSelectorsWithoutWysiwyg ) );
7171
}
7272
};
7373

0 commit comments

Comments
 (0)