WordPress.org

Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #47478, comment 7


Ignore:
Timestamp:
09/14/2019 01:34:05 AM (18 months ago)
Author:
pierlo
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #47478, comment 7

    v1 v2  
    1 Took some time out and managed to solve this. The `_listeners` object was being applied to the `states` Collection in the StateMachine, instead of the StateMachine itself. This is because of a change in Backbone v1.4.0 which applies listeners to the object's public `on` method (in this case the StateMachine maps events and triggers to the `states` object).
     1Took some time out and managed to solve this. The `_listeners` object was being applied to the `states` Collection in the StateMachine (aka `this.controller`), instead of the StateMachine itself. This is because of a change in Backbone v1.4.0 which applies listeners to the object's public `on` method (in this case the StateMachine maps events and triggers to the `states` object).
    22
    33[https://core.trac.wordpress.org/attachment/ticket/47478/47478.3.patch 47478.3.patch] fixes this by passing the `states` object instead of the StateMachine. I also refactored StateMachine to remove some dead code.