-
Notifications
You must be signed in to change notification settings - Fork 7
feat(oui-slideshow): add new slideshow component #184
Conversation
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.
Caution on DOM manipulations outside digest loop/$timeout, we could have surprises in some cases. Apart from that, it's OK :)
|
||
| Attribute | Type | Binding | One-time Binding | Values | Default | Description | | ||
| ---- | ---- | ---- | ---- | ---- | ---- | ---- | | ||
| `on-dismiss` | function | &? | | | | dismiss callback | |
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.
(optional) For functions, you could set the binding to &
directly.
If undefined
, it will call angular.noop()
instead.
this._isTouch = "ontouchstart" in window || navigator.msMaxTouchPoints > 0; | ||
this._client = { x: 0, y: 0 }; | ||
|
||
this.$document.on("keydown", evt => this._triggerKeyHandler(evt)); |
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.
Should be in $postLink
} | ||
|
||
$postLink () { | ||
this.panels = this.$element[0].querySelectorAll("oui-modal-on-boarding-panel"); |
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.
Since there is DOM manipulations in your $postLink, we should wrap all with
this.$timeout(() => {
[...]
});
this._isSliding = true; | ||
const nextIsIllustrated = this._isIllustratedPanel(nextPanelIndex); | ||
|
||
$nextPanel.addClass(direction); |
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.
Same as $postLink.
This should be in your $timeout below
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.
DOM is sure all loaded at this time.
I don't think is required to do that !
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 think it's not necessary. $timeout
is useful when we make DOM manipulation in $postLink
because we're not sure that DOM has been inserted yet. Here, the DOM is clearly ready.
</div> | ||
<div class="oui-modal-on-boarding__footer"> | ||
<div class="oui-modal-on-boarding__indicators" | ||
data-ng-if="$ctrl.panels.length > 1"> |
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.
No need of prefixing in our template
@rfougier Can you link all your PRs in the description ? Thanks :) |
@AxelPeter @rfougier You might consider using a |
00ff39b
to
8de220a
Compare
keyCode: 27 | ||
}); | ||
|
||
// expect(dismissSpy).toHaveBeenCalled(); |
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.
We don't test anything in this test.
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 forgot to go back on it...
this._isSliding = true; | ||
const nextIsIllustrated = this._isIllustratedPanel(nextPanelIndex); | ||
|
||
$nextPanel.addClass(direction); |
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 think it's not necessary. $timeout
is useful when we make DOM manipulation in $postLink
because we're not sure that DOM has been inserted yet. Here, the DOM is clearly ready.
8de220a
to
c2461f5
Compare
144046d
to
4dbd58b
Compare
4dbd58b
to
1b38be4
Compare
1b38be4
to
a27a89f
Compare
* feat(oui-modal-on-boarding): add oui-modal-on-boarding feature * chore: rename component to oui-slideshow * chore(oui-slideshow): add onboarding theme
/#!/oui-angular/modal-on-boarding
@ovh_ui_kit_documentation-feature_oui_modal_on_boarding
Linked to
ovh/ovh-ui-kit#208
ovh-ux/ovh-ui-kit-documentation#104