]> source.dussan.org Git - nextcloud-server.git/commitdiff
merge changes discussed in dcneiner pull number 4 'fix for autocomplete issue' includ...
authorJörn Friedrich Dreyer <jfd@butonic.de>
Tue, 4 Dec 2012 12:32:55 +0000 (13:32 +0100)
committerJörn Friedrich Dreyer <jfd@butonic.de>
Tue, 4 Dec 2012 12:32:55 +0000 (13:32 +0100)
core/js/jquery.infieldlabel.js

index 67608493f8a951521c5c00f6dce1aed7ce0dd8f4..c7daf61edd806892f6bbcdc5b961b51f08f21ffc 100644 (file)
@@ -7,7 +7,7 @@
  * Uses the same license as jQuery, see:
  * http://docs.jquery.com/License
  *
- * @version 0.1.2
+ * @version 0.1.6
  */
 (function ($) {
 
       base.options = $.extend({}, $.InFieldLabels.defaultOptions, options);
 
       // Check if the field is already filled in
-      if (base.$field.val() !== "") {
-        base.$label.hide();
-        base.showing = false;
-      }
+      // add a short delay to handle autocomplete
+      setTimeout(function() {
+        if (base.$field.val() !== "") {
+          base.$label.hide();
+          base.showing = false;
+        }
+      }, 200);
 
       base.$field.focus(function () {
         base.fadeOnFocus();
         base.checkForEmpty();
       }).bind('onPropertyChange', function () {
         base.checkForEmpty();
+      }).bind('keyup.infieldlabel', function () {
+        base.checkForEmpty()
       });
+      setInterval(function(){
+          if(base.$field.val() != ""){
+               base.$label.hide();
+               base.showing = false;
+        };
+      },100);
     };
 
     // If the label is currently showing