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
Bug 1112131 - Start end attributes rtl friendly #16
Bug 1112131 - Start end attributes rtl friendly #16
Conversation
57240a1
to
03abcb8
Compare
@@ -375,7 +366,7 @@ module.exports = Component.register('gaia-header', { | |||
* @private | |||
*/ | |||
isSupportedAction: function(action) { | |||
return action && actionTypes[action]; | |||
return !!(action && actionTypes[action]); |
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 was breaking "toggle" when action was undefined; now we always return a real boolean
03abcb8
to
2335cc4
Compare
*/ | ||
var privMap = new WeakMap(); | ||
|
||
function getPriv(instance) { |
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 seems like quite a complicated way to cache start
and end
attributes? Can't we just store them on the heading instance?
heading.dataset.start = start;
heading.dataset.end = end;
f9ea303
to
4a573f7
Compare
} | ||
|
||
if (width !== undefined) { | ||
priv.width = width; |
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.
width
is 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.
:D was very rough draft ;)
4a573f7
to
cc77a70
Compare
@@ -18,6 +18,8 @@ require('gaia-icons'); | |||
*/ | |||
var actionTypes = { menu: 1, back: 1, close: 1 }; | |||
|
|||
const KNOWN_ATTRIBUTES = ['action', 'available-width', 'no-font-fit', 'title-start', 'title-end']; |
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.
So, the available-width
is not used or am I missing something?
* simplify the definition of the attrs attribute using an external function * sanitize the attribute values in the setter * use the attribute getter instead of acessing the raw value * remove side effects from merely setting a value, allowing to use the value sanitizer from the "created" method. * Do not run reformatHeading when start/end are set, if no-font-fit is set. * Fix the implementation for "available-width" * Add more unit tests, especially for "available-width" behavior
cc77a70
to
4041f27
Compare
No description provided.