mirror of
				https://github.com/mdbootstrap/mdb-ui-kit.git
				synced 2025-11-04 09:57:36 +03:00 
			
		
		
		
	Standardized hints while providing backwards compatibility on data-hint
This commit is contained in:
		
							parent
							
								
									2d52fc271c
								
							
						
					
					
						commit
						36896a585b
					
				| 
						 | 
					@ -506,7 +506,7 @@
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <div class="form-group">
 | 
					            <div class="form-group">
 | 
				
			||||||
              <input type="text" class="form-control floating-label" placeholder="old floating label" data-hint="old hint attribute">
 | 
					              <input type="text" class="form-control floating-label" placeholder="old floating label" data-hint="This is a hint using a <code>data-hint</code> attribute on the input">
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <h2>Textarea</h2>
 | 
					            <h2>Textarea</h2>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -78,9 +78,9 @@
 | 
				
			||||||
          console.error("Expected form-group for input", $this);
 | 
					          console.error("Expected form-group for input", $this);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (!$this.attr("data-hint") && !$this.hasClass("floating-label")) {
 | 
					        //if (!$this.attr("data-hint") && !$this.hasClass("floating-label")) {
 | 
				
			||||||
          return;
 | 
					        //  return;
 | 
				
			||||||
        }
 | 
					        //}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $this.after("<span class=material-input></span>");
 | 
					        $this.after("<span class=material-input></span>");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -91,9 +91,10 @@
 | 
				
			||||||
          $this.after("<div class=floating-label>" + placeholder + "</div>");
 | 
					          $this.after("<div class=floating-label>" + placeholder + "</div>");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Add hint label if required
 | 
					
 | 
				
			||||||
 | 
					        // Add hint label if using the shorthand data-hint attribute on the input
 | 
				
			||||||
        if ($this.attr("data-hint")) {
 | 
					        if ($this.attr("data-hint")) {
 | 
				
			||||||
          $this.after("<div class=hint>" + $this.attr("data-hint") + "</div>");
 | 
					          $this.after("<p class='help-block hint'>" + $this.attr("data-hint") + "</p>");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Set as empty if is empty (damn I must improve this...)
 | 
					        // Set as empty if is empty (damn I must improve this...)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user