Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Fix behavior of update button #83

Merged
merged 2 commits into from Aug 27, 2016
Merged

Fix behavior of update button #83

merged 2 commits into from Aug 27, 2016

Conversation

westonruter
Copy link
Contributor

@PatelUtkarsh I need your help to fix some apparent regressions that were introduced with scheduling. Namely there is logic currently in populateSetting that seems like it should be refactored and moved to addButtons.

See #81 for details on the bug needing to be fixed.

Fixes #81

@westonruter westonruter added this to the 0.5.2 milestone Aug 24, 2016
} else {
save.html( component.data.i18n.updateButton );
save.text( component.data.i18n.saveButton );
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all of this logic related to the buttons should be moved to addButton.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could move this logic to addButton but we also want to tie this logic on date input change so I kept it separate. But yes I see the advantage of keeping all button logic in addButton.
Maybe we should create a event for schedule and bind this button logic in addButton with that event? (using wp.customize.state.create)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, creating more states would be good and then listening for changes to those states in a centralized location I think is the best architecture.

@PatelUtkarsh
Copy link
Member

@westonruter I've refactored code as you suggested in #83 (comment) as part of PR #76 - e27ed55
Let me know if it requires any changes.

Bug #81 is also fixed in 3e26906

@westonruter westonruter changed the title [WIP] Fix behavior of update button Fix behavior of update button Aug 27, 2016
@westonruter westonruter merged commit 2a1ce07 into develop Aug 27, 2016
@westonruter westonruter deleted the bugfix/update-button branch August 27, 2016 23:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Publishing changes without first updating a snapshot causes unexpected behavior
2 participants