node-horseman icon indicating copy to clipboard operation
node-horseman copied to clipboard

Compact selector exists/visible conditionals

Open aexaey opened this issue 8 years ago • 1 comments

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 avatar Feb 28 '17 04:02 aexaey

Or, same in javascript:

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

vs.

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

aexaey avatar Feb 28 '17 04:02 aexaey