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

Let viewportW/viewportH methods compare min #3

Open
ryanve opened this issue Aug 22, 2013 · 1 comment
Open

Let viewportW/viewportH methods compare min #3

ryanve opened this issue Aug 22, 2013 · 1 comment

Comments

@ryanve
Copy link
Owner

ryanve commented Aug 22, 2013

The 1.7- viewport methods are simple getters:

$.viewportW() // get viewport width
$.viewportH() // get viewport height

It could be useful to let these support a min parameter that compares and returns boolean:

$.viewportW(min) // true if viewport is at least `min` wide
_.find(list, $.viewportW) // use case

Are there pitfalls in adding the (min) syntax? It seems rather expressive. Going further to add (min, max) would be problematic for the _.find use case above because of the indices.

@ryanve
Copy link
Owner Author

ryanve commented Aug 22, 2013

A separate method like $.between.call(test, min, max) for use like _.find(list, $.between, $.viewportW) is possible alternative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant