can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[livejournal] r18495: OPSC-304: Modify invitation window. Fix ...

Committer: dpetrov
OPSC-304: Modify invitation window. Fix placeholder support checks in textarea.
U   trunk/htdocs/js/jquery_fn.js
Modified: trunk/htdocs/js/jquery_fn.js
===================================================================
--- trunk/htdocs/js/jquery_fn.js	2011-03-10 06:31:41 UTC (rev 18494)
+++ trunk/htdocs/js/jquery_fn.js	2011-03-10 06:40:38 UTC (rev 18495)
@@ -107,10 +107,6 @@
 
 //this one is fields type agnostic but creates additional label elements, which need to be styled
 jQuery.fn.labeledPlaceholder = function() {
-	if ('placeholder' in document.createElement('input')) {
-		return this;
-	}
-
 	function focus_action( input, label ) {
 		label.hide();
 	}
@@ -122,6 +118,14 @@
 	}
 
 	return this.each( function() {
+
+		if ('placeholder' in document.createElement('input') && this.tagName.toLowerCase() === "input" ) {
+			return;
+		}
+		if ('placeholder' in document.createElement('textarea') && this.tagName.toLowerCase() === "textarea" ) {
+			return;
+		}
+
 		var $this = jQuery( this ),
 			placeholder = $this.attr( 'placeholder' );
 

Tags: can3p, js, livejournal
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments