Skip to content
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

Conversation

julienw
Copy link
Contributor

@julienw julienw commented Dec 18, 2014

No description provided.

@@ -375,7 +366,7 @@ module.exports = Component.register('gaia-header', {
* @private
*/
isSupportedAction: function(action) {
return action && actionTypes[action];
return !!(action && actionTypes[action]);
Copy link
Contributor Author

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

@julienw julienw force-pushed the start-end-attributes-rtl-friendly branch from 03abcb8 to 2335cc4 Compare January 5, 2015 12:26
*/
var privMap = new WeakMap();

function getPriv(instance) {
Copy link
Contributor

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;

@julienw julienw force-pushed the start-end-attributes-rtl-friendly branch 2 times, most recently from f9ea303 to 4a573f7 Compare January 6, 2015 12:52
}

if (width !== undefined) {
priv.width = width;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

width is undefined

Copy link
Contributor Author

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 ;)

@julienw julienw force-pushed the start-end-attributes-rtl-friendly branch from 4a573f7 to cc77a70 Compare January 8, 2015 16:13
@@ -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'];
Copy link
Contributor

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
@julienw julienw force-pushed the start-end-attributes-rtl-friendly branch from cc77a70 to 4041f27 Compare January 9, 2015 10:12
@wilsonpage wilsonpage closed this Feb 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants