feat(firstrun): Add fx_firstrun_v2 events to support new firstrun flow. #4717
Conversation
| @@ -15,20 +15,101 @@ define(function (require, exports, module) { | |||
| const _ = require('underscore'); | |||
| const Constants = require('lib/constants'); | |||
| const FxFirstrunV1AuthenticationBroker = require('./fx-firstrun-v1'); | |||
| const NotifierMixin = require('views/mixins/notifier-mixin'); | |||
shane-tomlinson
Feb 13, 2017
Author
Member
I didn't want to add more than this PR than necessary, but it's time to move this mixin into a shared location so it can be used by either views or models without the wonkiness of including a view mixin in a model. I'll do that as a separate PR.
I didn't want to add more than this PR than necessary, but it's time to move this mixin into a shared location so it can be used by either views or models without the wonkiness of including a view mixin in a model. I'll do that as a separate PR.
| enableForm () { | ||
| this.$('button[type=submit]').removeClass('disabled'); | ||
| this._isFormEnabled = true; | ||
| if (! this.isFormEnabled()) { |
shane-tomlinson
Feb 13, 2017
Author
Member
To avoid sending form.disabled and form.enabled every time either of these methods is called (which is pretty often), I only send the messages if a state change occurs.
To avoid sending form.disabled and form.enabled every time either of these methods is called (which is pretty often), I only send the messages if a state change occurs.
| isFormEnabled () { | ||
| return !! this._isFormEnabled; | ||
| return ! this.$('button[type=submit]').hasClass('disabled'); |
shane-tomlinson
Feb 13, 2017
Author
Member
This is modified to checking the DOM instead of relying on an internal variable because sometimes the form is disabled from the template.
This is modified to checking the DOM instead of relying on an internal variable because sometimes the form is disabled from the template.
|
The failing travis tests are the |
Add several new events that are reported to the parent IFRAME: * `navigated` called whenever the user opens a new page * `form_enabled` called whenever the form is enabled * `form_disabled` called whenever the form is disabled * `form_engaged` called whenever the user modifies an input element A lot of unit test suites needed to be updated to create the Views with a notifier reference.
|
If it's relevant, I don't need the |
|
Thanks @ericawright, I'll keep the extra event in for now - the code is in production. |
Add several new events that are reported to the parent IFRAME:
navigatedcalled whenever the user opens a new pageform_enabledcalled whenever the form is enabledform_disabledcalled whenever the form is disabledform_engagedcalled whenever the user modifies an input elementA lot of unit test suites needed to be updated to create the Views with
a notifier reference.
fixes https://github.com/mozilla/fxa-bugzilla-mirror/issues/239
@vladikoff - r?