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

callback #1

Open
julian-ca opened this issue Jun 28, 2018 · 2 comments
Open

callback #1

julian-ca opened this issue Jun 28, 2018 · 2 comments

Comments

@julian-ca
Copy link

do we have a way to add a callback function where the argument is the height of the elements?

like:

SameHeight.init('.card-header-title').then(function(newHeight) {
    console.log(newHeight);
})

I have a use case where I wanted to center the texts vertically using the height.

@davejtoews
Copy link
Owner

I've never set this up to use callbacks, though that's an interesting idea and you're welcome to make a pull request.

You may be able to solve your problem using LayoutQueue which is a dependency of this repo. That way you can set up a series of actions which take place on page-load, resize, or any custom triggers. Put SameHeight is in your queue just prior to whatever it is you want to do afterwards.

@julian-ca
Copy link
Author

julian-ca commented Jul 4, 2018

Hi @davejtoews,

Yes, I did a workaround using LayoutQueue, but it would be better to include such functionality to make it straight-forward as it is the most common thing a developer thinks.

I will submit a PR if I will have the time. Thanks for the response. :)

This library works great!

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