-
Notifications
You must be signed in to change notification settings - Fork 89
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
BEMHTML: use proper boolean values for attribute #1747
Conversation
А где почитать — почему теперь булеан нужно строку оборачивать? |
@voischev На проектах — не нужно. Этот коммит про то, чтобы один набор эталонов подходил для В следующем мажоре эти изменения нужно будет откатить. |
@@ -1,3 +1,3 @@ | |||
block('button').mod('togglable', 'radio').attrs()(function() { | |||
return this.extend(applyNext(), { 'aria-pressed' : !!this.mods.checked }); | |||
return this.extend(applyNext(), { 'aria-pressed' : (!!this.mods.checked).toString() }); |
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.
String(!!this.mods.checked)
?
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.
Спасибо, везде поправила.
@tadatuta понял спасибо |
@tadatuta Разве нужно будет? |
f994f18
to
9d4e5dd
Compare
@@ -17,8 +17,8 @@ block('menu-item')( | |||
attrs = { | |||
role : role, | |||
id : this.generateId(), | |||
'aria-disabled' : mods.disabled, | |||
'aria-checked' : menuMode && !!mods.checked | |||
'aria-disabled' : mods && mods.disabled && 'true' || undefined, |
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.mods
гарантируется ядром, а если mods.disabled
окажется falsy, то это и есть undefined
так что можно сократить до
'aria-disabled' : mods.disabled && 'true'
в остальном — lgtm
9d4e5dd
to
48b8ae4
Compare
@tadatuta все тесты пропассились, кроме диста https://travis-ci.org/bem/bem-components/jobs/108494214 Но я не поняла что он хочет, если честно. |
он просит, чтобы его перезапустили) |
@gela-d теперь все ок |
|
BEMHTML: use proper boolean values for attribute
@tadatuta
Close #1745