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

Don't showing more than 4 child elements #28

Closed
c0nf1gur4t0r opened this issue Apr 27, 2015 · 7 comments
Closed

Don't showing more than 4 child elements #28

c0nf1gur4t0r opened this issue Apr 27, 2015 · 7 comments

Comments

@c0nf1gur4t0r
Copy link

Notice that when I put more than 4 elements, the directive simply ignore the "excess".

See here: http://plnkr.co/edit/BcGEhsLSoFxhgDLzon26

So what is going wrong? Please, can you help me?

@nobitagit
Copy link
Owner

You have to rebuild the CSS file accordingly as to support as many buttons as needed. See the docs for the way to do it properly. Let me know if you need further help.

@c0nf1gur4t0r
Copy link
Author

Really thanks a lot, but in a cenario that intends to be more dinamic as possible, how I could do these adjusts dinamically?

@nobitagit
Copy link
Owner

Being it tied to a css stylesheet there is no way to recompile it on the fly, as far as I know. You could sort of replicate the logic behind the scss to work in the JavaScript and calculate the positions dynamically but in the end i am quite sure that the cost in term of work and performance would just not be justified.

My suggestion: simply define a sensible maximum amount of buttons your layout can support (I hardly see anyone needing more than 7-8 buttons, let alone have sufficient real estate for them in the page), choose an effect and make a custom build as explained in the docs linked above.

You'll end up with some lines of potentially unused CSS but it will probably affect next to zero your overall performance and your layout will support a variable amount of buttons from 0 to n without any problem.

@c0nf1gur4t0r
Copy link
Author

I've decided to solve the problem as you have said, that is define sensibly the maximum amount of buttons. But by the Docs that you've sent me, I changed just the property "$number-of-child-buttons" to "5" instead "4 !default" and I rebuilt the SASS file to generate CSS. Sadly, I think isn't just that.

Please, can you help me? Best regards.

@nobitagit
Copy link
Owner

Check this Plunkr.

I generated the css form a scss file like the my-custom.scss you see in the Plunkr, which is simply:

$number-of-child-buttons: 6;
$effects-slidein: false;
$effects-slidein-spring: false;
$effects-fountain: false;
@import "../bower_components/ng-mfb/mfb/src/mfb.scss";

You just need to tell your task runner to compile this my-custom.scss file and it will generate the appropriate code in your own css.

@c0nf1gur4t0r
Copy link
Author

Yeah yeah, I've managed it yesterday but thanks a lot.

@ghost
Copy link

ghost commented Apr 22, 2017

$number-of-child-buttons: 6; works fine. thanks

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

No branches or pull requests

2 participants