Initial OpenECOMP Portal commit
[portal.git] / ecomp-portal-FE / client / bower_components / jquery.event.drag-new / event.keyend / jquery.event.keyend.js
diff --git a/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.keyend/jquery.event.keyend.js b/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.keyend/jquery.event.keyend.js
new file mode 100644 (file)
index 0000000..f4a29cf
--- /dev/null
@@ -0,0 +1,20 @@
+;(function( $ ){
+       $.fn.keyend = function( fn ){
+               return this[ fn ? "bind" : "trigger" ]( "keyend", fn );
+       };
+       var keyend = $.event.special.keyend = {
+               delay: 400,
+               setup: function( data ){
+                       $( this ).bind("keypress",{ delay: data.delay }, keyend.handler );
+               },
+               teardown: function(){
+                       $( this ).unbind("keypress", keyend.handler );
+               },
+               handler: function( event ){
+                       clearTimeout( event.data.timer );
+                       event.data.timer = setTimeout(function(){
+                               $( event.currentTarget ).keyend();
+                       }, event.data.delay || keyend.delay );
+               }
+       };
+})( jQuery );
\ No newline at end of file