mirror of
https://github.com/mdbootstrap/mdb-ui-kit.git
synced 2024-11-25 11:04:09 +03:00
added support for dynamically added inputs
This commit is contained in:
parent
f76e82f78b
commit
87a3791071
|
@ -4,14 +4,16 @@ $(function (){
|
|||
|
||||
ripples.init(".btn:not(.btn-link), .navbar a, .nav-tabs a, .withripple");
|
||||
|
||||
$(document).bind("DOMSubtreeModified", function(){
|
||||
// Add fake-checkbox to material checkboxes
|
||||
$(".checkbox > label > input").after("<span class=check></span>");
|
||||
$(".checkbox > label > input").not(".bs-material").addClass("bs-material").after("<span class=check></span>");
|
||||
|
||||
// Add fake-radio to material radios
|
||||
$(".radio > label > input").after("<span class=circle></span><span class=check></span>");
|
||||
$(".radio > label > input").not(".bs-material").addClass("bs-material").after("<span class=circle></span><span class=check></span>");
|
||||
|
||||
// Add elements for material inputs
|
||||
$("input.form-control, textarea.form-control, select.form-control").each( function() {
|
||||
$("input.form-control, textarea.form-control, select.form-control").not(".bs-material").each( function() {
|
||||
$(this).addClass("bs-material");
|
||||
$(this).wrap("<div class=form-control-wrapper></div>");
|
||||
$(this).after("<span class=material-input></span>");
|
||||
if ($(this).hasClass("floating-label")) {
|
||||
|
@ -30,6 +32,9 @@ $(function (){
|
|||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
$(document).on("keyup change", ".form-control", function() {
|
||||
var self = $(this);
|
||||
setTimeout(function() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user