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

Compact selector exists/visible conditionals #266

Open
aexaey opened this issue Feb 28, 2017 · 1 comment
Open

Compact selector exists/visible conditionals #266

aexaey opened this issue Feb 28, 2017 · 1 comment

Comments

@aexaey
Copy link

aexaey commented Feb 28, 2017

Wouldn't it be nice if instead of 4 lines to test for and act upon element existence/visibility:

  .visible '#foo'
  .then (a) ->
    if a
      # do something

...one would only need 2:

  .if_visible '#foo', () ->
      # do something
aexaey added a commit to aexaey/node-horseman that referenced this issue Feb 28, 2017
@aexaey
Copy link
Author

aexaey commented Feb 28, 2017

Or, same in javascript:

.visible('#foo')
.then(function(a) {
    if (a) {
        ...

vs.

.if_visible('#foo', function() {
        ...

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

1 participant