-
Notifications
You must be signed in to change notification settings - Fork 15
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
IBX-6843: Focus mode #955
IBX-6843: Focus mode #955
Conversation
c61a624
to
8581f21
Compare
|
||
doc.body.addEventListener( | ||
ENABLE_FOCUS_MODE_EVENT_NAME, | ||
() => doc.body.addEventListener('keydown', watchDisableFocusModeByKeyboard), |
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.
() => doc.body.addEventListener('keydown', watchDisableFocusModeByKeyboard), | |
() => doc.body.addEventListener('keydown', watchDisableFocusModeByKeyboard, 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.
We use it everywhere like this but u know @GrabowskiM its default false? 🧆
} | ||
}; | ||
const watchDisableFocusModeByKeyboard = (event) => { | ||
if (event.key === 'Escape' || event.keyCode === 27) { |
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 (event.key === 'Escape' || event.keyCode === 27) { | |
if (event.key === 'Escape') { |
@@ -270,7 +270,6 @@ | |||
|
|||
{%- block richtext_widget -%} | |||
{% set attr = attr|merge({ 'hidden': true }) %} | |||
|
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.
unnecessary deletion :)
</svg> | ||
{%- endset -%} | ||
{%- set title -%} | ||
{{ 'focus_mode.disbale_hint'|trans({ '%icon%': title_icon|raw })|desc('To exit focus mode, click the %icon% or press Esc')|raw }} |
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.
{{ 'focus_mode.disbale_hint'|trans({ '%icon%': title_icon|raw })|desc('To exit focus mode, click the %icon% or press Esc')|raw }} | |
{{ 'focus_mode.disable_hint'|trans({ '%icon%': title_icon|raw })|desc('To exit focus mode, click the %icon% or press Esc')|raw }} |
|
||
.ibexa-field-edit { | ||
&__focus-mode { | ||
margin: auto 0 0 0; |
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.
margin: auto 0 0 0; | |
margin: auto 0 0; |
const ENABLE_FOCUS_MODE_EVENT_NAME = 'ibexa-focus-mode:on'; | ||
const DISABLE_FOCUS_MODE_EVENT_NAME = 'ibexa-focus-mode:off'; |
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?
const ENABLE_FOCUS_MODE_EVENT_NAME = 'ibexa-focus-mode:on'; | |
const DISABLE_FOCUS_MODE_EVENT_NAME = 'ibexa-focus-mode:off'; | |
const FOCUS_MODE_ON_EVENT = 'ibexa-focus-mode:on'; | |
const FOCUS_MODE_OFF_EVENT = 'ibexa-focus-mode:off'; |
const ENABLE_FOCUS_MODE_EVENT_NAME = 'ibexa-focus-mode:on'; | |
const DISABLE_FOCUS_MODE_EVENT_NAME = 'ibexa-focus-mode:off'; | |
const FOCUS_MODE_ENABLE_EVENT = 'ibexa-focus-mode:enable'; | |
const FOCUS_MODE_DISABLE_EVENT = 'ibexa-focus-mode:disable'; |
@@ -0,0 +1,61 @@ | |||
(function (global, doc) { |
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 stick to one logic enable/disable || on/off?
activeFieldEdit = null; | ||
} | ||
}; | ||
const watchDisableFocusModeByKeyboard = (event) => { |
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.
Why we always add Keyboard with func name for keydown but never Click when using click? 😄
Maybe exitFocusMode || exitFocusModeByKeyboard
overflow-y: auto; | ||
align-self: stretch; | ||
flex-grow: 1; | ||
padding: calculateRem(8px) calculateRem(32px) calculateRem(32px) calculateRem(32px); |
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.
padding: calculateRem(8px) calculateRem(32px) calculateRem(32px) calculateRem(32px); | |
padding: calculateRem(8px) calculateRem(32px) calculateRem(32px); |
102de3f
to
7861b7d
Compare
7861b7d
to
5b028ae
Compare
87fa2f0
to
7440479
Compare
efac032
to
c7fdb2f
Compare
c7fdb2f
to
76c827b
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
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.
QA Approved on Ibexa Commerce 4.6.x-dev.
Related PR's
Normal view
Focus mode view
Checklist:
$ composer fix-cs
)