-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add generic options object to App init #46
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
Next Release | ||
------------- | ||
1.9.0 | ||
------ | ||
* Add generic options object to App init. #46 | ||
|
||
1.8.1 | ||
------ | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,10 +16,13 @@ class Application extends EventEmitter { | |
* @param options.targetSelectors A DOMString containing one or more selectors to match against. | ||
* This string must be a valid CSS selector string; if it's not, | ||
* a SyntaxError exception is thrown. | ||
* @param options.options An optional object used for App to transmit details to frame | ||
* after App is authorized. | ||
*/ | ||
init({ acls = [], secret = null, onReady = null, targetSelectors = '' }) { | ||
init({ acls = [], secret = null, onReady = null, targetSelectors = '', options = {} }) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add documentation for this new parameter. |
||
this.acls = [].concat(acls); | ||
this.secret = secret; | ||
this.options = options; | ||
this.onReady = onReady; | ||
this.targetSelectors = targetSelectors; | ||
this.resizeConfig = null; | ||
|
@@ -251,7 +254,7 @@ class Application extends EventEmitter { | |
|
||
// Emit a ready event | ||
this.emit('xfc.ready'); | ||
this.JSONRPC.notification('authorized', [{ url: window.location.href }]); | ||
this.JSONRPC.notification('authorized', [{ url: window.location.href, options: this.options }]); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we always send options or should we only send if it has something? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it non-passive? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it is just extra info object always present/received, it could be read or ignored. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have no problem with always sending it then There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is any work required to make this available on the Consumer? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need any changes on Consumer as we are merging in the new options object with url into one detail object. https://github.com/cerner/xfc/blob/master/src/consumer/frame.js#L51 |
||
|
||
// If there is an onReady callback, execute it | ||
if (typeof this.onReady === 'function') { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would be a 1.9 feature release. Also, we need README documentation on how to use this new feaature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will update it.