Sha256: d3d7eb3ce8338dccd7ed1fba92c0a05712d469e5eb48c667884780124809309e
Contents?: true
Size: 686 Bytes
Versions: 113
Compression:
Stored size: 686 Bytes
Contents
angular.module('NgChangeOnBlur', []) .directive 'ngChangeOnBlur', ($timeout)-> restrict: 'A', require: 'ngModel', link: (scope, element, attributes, ngModelCtrl) -> return if (attributes.type == 'radio' || attributes.type == 'checkbox') callFunction = attributes.ngChangeOnBlur oldValue = null element.bind 'focus', -> scope.$apply -> oldValue = element.val() element.bind 'blur', (event) -> delay = if element.hasClass('autocomplete') then 300 else 0 $timeout -> scope.$apply -> newValue = element.val() scope.$eval(callFunction) if (newValue != oldValue) , delay
Version data entries
113 entries across 113 versions & 1 rubygems