-
Notifications
You must be signed in to change notification settings - Fork 6.7k
feat(collapse): add possibility to collapse horizontally #6010
Conversation
New directive to collapse horizontally or vertically : put 'horizontal' to collapse horizontally or pu nothing to do vertically
Correct the horizontal collapse example
Forget to detect the 'horizontal' attribute
easing: 'ease', | ||
to: { height: element[0].scrollHeight + 'px' } | ||
}).start()['finally'](expandDone); | ||
if (horizontal) { |
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 probably would be worthwhile converting everything in here into a helper function to avoid duplication between horizontal and vertical collapsing.
This mostly looks good, just needs some code cleanup to avoid unnecessary repetition. |
Refactor to avoid duplication
Sorry for two of my commit. Pluckr updated : http://plnkr.co/edit/EXr6cBJ58wfRRDlvCl5i?p=preview |
We have an open issue (#3593) for this. Thank you for taking the initiative to do this... |
horizontal = !!('horizontal' in attrs); | ||
if (horizontal) { | ||
cssWidth = {width: 'auto'}; | ||
cssHeight = {height: 'inherit'}; |
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.
Height and width can be combined into one object, i.e.
css = {
width: 'auto',
height: 'inherit'
};
A lot of minor issues, clean those up and this should be good to go |
Refactor to had one call of css() and remove spaces
@icfantv I needed this feature so i made it and i sent it here :) |
cssTo = {width: '0'}; | ||
} else { | ||
cssWidth = {width: 'inherit'}; | ||
cssHeight = {height: 'auto'}; | ||
css = { |
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.
the same CSS is in both if
blocks - that can be combined.
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 is different CSS - note the inversion of order of values
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 is this good ? I can't combine because that's not the same value.
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.
Yep, it's fine
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.
gah! sorry. i totally missed that.
I think this is good for merge - what do you think @icfantv? |
Yep, doooo eeeeeet. |
New attribute to collapse horizontally or vertically : put 'horizontal' to collapse horizontally or put nothing to do it vertically
Plunkr : http://plnkr.co/edit/EXr6cBJ58wfRRDlvCl5i?p=preview
Fixes #3593