-
Notifications
You must be signed in to change notification settings - Fork 10.3k
[ADD] developer: scroller service added #1313
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
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.
hmm, it's not a part of the scroller service, is it?
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.
It is not, so I don't know if and were I could document 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.
@ged-odoo I removed it. Is it better now?
976411f
to
4d23086
Compare
- Technical name: `scroller` | ||
- Dependencies: none | ||
|
||
Provides a way to handle scrolls to anchors in the webclient. |
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.
maybe clearer to explain what it does. Suggestion: Replace the 2 lines with:
Whenever the user clicks on an anchor in the web client, this service automatically scrolls
to the target (if appropriate).
Provides a way to handle scrolls to anchors in the webclient. | ||
This service is used whenever a click occurs on the webclient. | ||
|
||
The service adds an event listener to get `click`'s on the document. The service is then |
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.
use present tense: is then checking
=> checks
|
||
The service adds an event listener to get `click`'s on the document. The service is then | ||
checking if the selector contained in its href attribute is valid to distinguish anchors and Odoo | ||
actions (e.g. ``<a href="#target_element"></a>``). It returns nothing if it is not the case. |
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.
it does not returns nothing. it just does nothing.
checking if the selector contained in its href attribute is valid to distinguish anchors and Odoo | ||
actions (e.g. ``<a href="#target_element"></a>``). It returns nothing if it is not the case. | ||
|
||
An event ``SCROLLER:ANCHOR_LINK_CLICKED`` is triggered on the main application bus. That event contains a |
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 the click seems to be targeted at an element, then an event ...
An event ``SCROLLER:ANCHOR_LINK_CLICKED`` is triggered on the main application bus. That event contains a | ||
custom event containing the `element` matching and its `id` to notify other parts that may need to handle | ||
an anchor behavior themselves. The original event is also given as it might need to be prevented. Otherwise, | ||
the ``scrollTo`` function is used to handle the scroll to the correct element directly in the service. |
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.
here and elsewhere: you can use single quote instead of double quote
|
||
An event ``SCROLLER:ANCHOR_LINK_CLICKED`` is triggered on the main application bus. That event contains a | ||
custom event containing the `element` matching and its `id` to notify other parts that may need to handle | ||
an anchor behavior themselves. The original event is also given as it might need to be prevented. Otherwise, |
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.
replace Otherwise with: `If the event is not prevented, then the user interface will scroll to the target element.
No need to explain that it uses the scrollto function. this is an internal implementation detail
4d23086
to
31d299b
Compare
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.
@robodoo delegate+
@robodoo delegate=ged-odoo |
This commit adds the documentation related to the scroller service. This service is used for the webclient to handle clicks on links and there were no documentation related until now.
31d299b
to
f809e7b
Compare
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 to rerequest a review if you only fixed a minor typo.
You can merge it or leave the r+ to ged, the delegate has effect even after a force-push anyway
@robodoo r+ |
I'm sorry, @Iucapad. I must know your email before you can review PRs. Please contact an administrator. |
robodoo r+ |
|
This commit adds the documentation related to
the scroller service. This service is used for
the webclient to handle clicks on links and there
were no documentation related until now.