-
Notifications
You must be signed in to change notification settings - Fork 88
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
Support modal disclaimers #1348
Conversation
Ready for review, and I expect to have lots of comments. |
61af0cf
to
e13f2eb
Compare
*/ | ||
this.modal; | ||
|
||
this.modal = this.modal !== undefined ? this.modal : false; |
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.
Please prefere this.modal = this.modal === true ? this.modal : false;
for this test.
Else modal can be toto
or null
etc.
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.
I don't understand what you mean. this.modal
should be false by default.
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.
If you set up the directive with something like ... gmf-disclaimer-modal="ctrl.map"...
, this.modal
will be a map object. This is why @ger-benjamin prefers to use this.modal = this.modal === true
.
I would use two different variables. E.g. set up the scope with:
scope: {
'modalIn': '<?gmfDisclaimerModal',
And then in your controller:
/**
* @type {boolean}
* @export
*/
this.modal = this['modalIn'] === true;
This way you are sure that this.modal
always has the correct type.
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.
That's a nice trick. I'll do this.
Result is strange on opening mutliple popups at the same time. Can you open an issue with that ? |
See: #1357 |
e13f2eb
to
c5a2dbf
Compare
Corrections applied. Ready for merge. |
|
||
/** | ||
* @type {boolean} | ||
* @export | ||
*/ | ||
this.modal = modal; | ||
this.modal = modal === 'true' ? true : false; |
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.
simpler with the exact same result...
this.modal = modal === 'true';
Just a micro comment also that's looks good :-) |
33884b6
to
47c1a7a
Compare
Rebased onto master and tiny fixed applied. |
Thanks :-) |
This PR adds the possibility to display disclaimer messages as modals instead of alerts in the disclaimer service (ngeo). The
gmf.disclaimer
directive now has an option that allows to turn this feature on (defaults to off).The gmf layer tree example has been modified to be able to show this in action using a url parameter.
Note: this PR currently includes the content of #1341, since it hasn't been merged yet.
Todo
Live demos