diff --git a/config/assets.yml b/config/assets.yml index 1e0620495..623482b29 100644 --- a/config/assets.yml +++ b/config/assets.yml @@ -11,7 +11,6 @@ javascripts: - public/javascripts/vendor/jquery152.min.js main: - public/javascripts/rails.js - - public/javascripts/vendor/jquery.infieldlabel.js - public/javascripts/vendor/jquery.tipsy.js - public/javascripts/vendor/jquery.hotkeys.js - public/javascripts/vendor/jquery.autoresize.min.js @@ -22,6 +21,7 @@ javascripts: - public/javascripts/vendor/Mustache.js - public/javascripts/vendor/charCount.js - public/javascripts/jquery.autocomplete-custom.js + - public/javascripts/jquery.infieldlabel-custom.js - public/javascripts/fileuploader-custom.js - public/javascripts/keycodes.js - public/javascripts/diaspora.js diff --git a/public/javascripts/vendor/jquery.infieldlabel.js b/public/javascripts/jquery.infieldlabel-custom.js similarity index 92% rename from public/javascripts/vendor/jquery.infieldlabel.js rename to public/javascripts/jquery.infieldlabel-custom.js index 3e3039221..ce1b67ff1 100644 --- a/public/javascripts/vendor/jquery.infieldlabel.js +++ b/public/javascripts/jquery.infieldlabel-custom.js @@ -15,7 +15,7 @@ // To avoid scope issues, use 'base' instead of 'this' // to reference this class from internal events and functions. var base = this; - + // Access to jQuery and DOM versions of each element base.$label = $(label); base.label = label; @@ -98,7 +98,7 @@ (e.keyCode === 16) || // Skip Shift (e.keyCode === 9) // Skip Tab ) { - return; + return; } if (base.showing) { @@ -134,19 +134,19 @@ // This fucking for_attr thing is some seriously dumb shit. // // It must be dealt with - $field = $( - "input#" + for_attr + "[type='text']," + - "input#" + for_attr + "[type='search']," + - "input#" + for_attr + "[type='tel']," + - "input#" + for_attr + "[type='url']," + - "input#" + for_attr + "[type='email']," + - "input#" + for_attr + "[type='password']," + + $field = $(this).siblings( + "input#" + for_attr + "[type='text']," + + "input#" + for_attr + "[type='search']," + + "input#" + for_attr + "[type='tel']," + + "input#" + for_attr + "[type='url']," + + "input#" + for_attr + "[type='email']," + + "input#" + for_attr + "[type='password']," + "textarea#" + for_attr ); if ($field.length === 0) { return; // Again, nothing to attach - } + } // Only create object for input[text], input[password], or textarea (new $.InFieldLabels(this, $field[0], options)); diff --git a/public/javascripts/view.js b/public/javascripts/view.js index d9c9cf932..8497500c2 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -15,6 +15,10 @@ var View = { /* In field labels */ $("label").inFieldLabels(); + $(document).bind('afterReveal.facebox', function() { + jQuery("#facebox label").inFieldLabels(); + }); + /* Showing debug messages */ $(this.debug.selector) @@ -66,7 +70,7 @@ var View = { $("#notification").delegate('.hard_object_link', 'click', function(evt){ var post = $("*[data-guid='"+ $(this).attr('data-ref') +"']"), lastComment = post.find('.comment.posted').last(); - + if(post.length > 0){ evt.preventDefault(); $('html, body').animate({scrollTop: parseInt(lastComment.offset().top)-80 }, 'fast');