Sha256: 0ab05f039432fd81f9b0646bea29f10f1b379ad393388302fcc30ae53222909b

Contents?: true

Size: 584 Bytes

Versions: 113

Compression:

Stored size: 584 Bytes

Contents

angular.module('NgWatchShow', [])
  .directive 'ngWatchShow', ($timeout)->
    link: (scope, element, attributes) ->
      scope.$watch attributes.ngWatchShow, (newVal) ->
        if (newVal)
          element.removeClass('ng-hide')
        else
          if element.is(":focus")
            inputs = document.getElementsByTagName('input')
            for input, index in inputs
              inputIndex = index if input == element[0]
            input = angular.element inputs[inputIndex + 1]
            $timeout ->
              input.focus()
          element.addClass('ng-hide')

Version data entries

113 entries across 113 versions & 1 rubygems

Version Path
material_raingular-0.6.16 lib/assets/javascripts/directives/ngwatchshow.js.coffee
material_raingular-0.6.15 lib/assets/javascripts/directives/ngwatchshow.js.coffee
material_raingular-0.6.14 lib/assets/javascripts/directives/ngwatchshow.js.coffee
material_raingular-0.6.13 lib/assets/javascripts/directives/ngwatchshow.js.coffee
material_raingular-0.6.12 lib/assets/javascripts/directives/ngwatchshow.js.coffee
material_raingular-0.6.11 lib/assets/javascripts/directives/ngwatchshow.js.coffee
material_raingular-0.6.10 lib/assets/javascripts/directives/ngwatchshow.js.coffee
material_raingular-0.6.9 lib/assets/javascripts/directives/ngwatchshow.js.coffee
material_raingular-0.6.8 lib/assets/javascripts/directives/ngwatchshow.js.coffee
material_raingular-0.6.7 lib/assets/javascripts/directives/ngwatchshow.js.coffee
material_raingular-0.6.6 lib/assets/javascripts/directives/ngwatchshow.js.coffee
material_raingular-0.6.5 lib/assets/javascripts/directives/ngwatchshow.js.coffee
material_raingular-0.6.4 lib/assets/javascripts/directives/ngwatchshow.js.coffee
material_raingular-0.6.3 lib/assets/javascripts/directives/ngwatchshow.js.coffee
material_raingular-0.6.2.3 lib/assets/javascripts/directives/ngwatchshow.js.coffee
material_raingular-0.6.2.2 lib/assets/javascripts/directives/ngwatchshow.js.coffee
material_raingular-0.6.2.1 lib/assets/javascripts/directives/ngwatchshow.js.coffee
material_raingular-0.6.2 lib/assets/javascripts/directives/ngwatchshow.js.coffee
material_raingular-0.6.1.1 lib/assets/javascripts/directives/ngwatchshow.js.coffee
material_raingular-0.6.1 lib/assets/javascripts/directives/ngwatchshow.js.coffee