fix indent

This commit is contained in:
colder 2014-10-05 20:35:02 +08:00
parent 11b439386a
commit e71af77d2f
5 changed files with 49 additions and 49 deletions

32
dist/js/material.js vendored
View File

@ -37,23 +37,24 @@ $(function (){
};
initInputs();
// Detect animationend event name.
var ANIMATION_END_EVENT = (function() {
var eventName,
ANIMATION_END_EVENT_NAMES = {
"animation": "animationend",
"-o-animation": "oAnimationEnd",
"-moz-animation": "animationend",
"-webkit-animation": "webkitAnimationEnd",
"-ms-animation": "animationend"
},
animateFakeEl = document.createElement("animatefakeelement");
var eventName,
ANIMATION_END_EVENT_NAMES = {
"animation": "animationend",
"-o-animation": "oAnimationEnd",
"-moz-animation": "animationend",
"-webkit-animation": "webkitAnimationEnd",
"-ms-animation": "animationend"
},
animateFakeEl = document.createElement("animatefakeelement");
for (eventName in ANIMATION_END_EVENT_NAMES) {
if (typeof(animateFakeEl.style[eventName]) !== "undefined") {
return ANIMATION_END_EVENT_NAMES[eventName];
for (eventName in ANIMATION_END_EVENT_NAMES) {
if (typeof(animateFakeEl.style[eventName]) !== "undefined") {
return ANIMATION_END_EVENT_NAMES[eventName];
}
}
}
return null;
return null;
})();
// Support for "arrive.js" to dynamically detect creation of elements
@ -68,8 +69,7 @@ $(function (){
$(document).on("change", ".checkbox input", function() {
// safari cannot auto focus when click.
var $checkbox = $(this).focus();
$checkbox.find("+ .check").one(ANIMATION_END_EVENT, function () {
console.log(ANIMATION_END_EVENT);
$checkbox.find("+ .check").one(ANIMATION_END_EVENT, function() {
$checkbox.blur();
});
});

View File

@ -1 +1 @@
$(function(){"object"==typeof ripples&&ripples.init(".btn:not(.btn-link), .navbar a:not(.withoutripple), .nav-tabs a:not(.withoutripple), .withripple");var a=function(){$(".checkbox > label > input").not(".bs-material").addClass("bs-material").after("<span class=check></span>"),$(".radio > label > input").not(".bs-material").addClass("bs-material").after("<span class=circle></span><span class=check></span>"),$("input.form-control, textarea.form-control, select.form-control").not(".bs-material").each(function(){if(!$(this).is(".bs-material")){if($(this).wrap("<div class=form-control-wrapper></div>"),$(this).after("<span class=material-input></span>"),$(this).hasClass("floating-label")){var a=$(this).attr("placeholder");$(this).attr("placeholder",null).removeClass("floating-label"),$(this).after("<div class=floating-label>"+a+"</div>")}if(($(this).is(":empty")||null===$(this).val()||"undefined"==$(this).val()||""===$(this).val())&&$(this).addClass("empty"),$(this).parent().next().is("[type=file]")){$(this).parent().addClass("fileinput");var b=$(this).parent().next().detach();$(this).after(b)}}})};a();var b=function(){var a,b={animation:"animationend","-o-animation":"oAnimationEnd","-moz-animation":"animationend","-webkit-animation":"webkitAnimationEnd","-ms-animation":"animationend"},c=document.createElement("animatefakeelement");for(a in b)if("undefined"!=typeof c.style[a])return b[a];return null}();document.arrive&&document.arrive("input, textarea, select",function(){a()}),$(document).on("change",".checkbox input",function(){var a=$(this).focus();a.find("+ .check").one(b,function(){console.log(b),a.blur()})}),$(document).on("keyup change",".form-control",function(){var a=$(this);setTimeout(function(){""===a.val()?a.addClass("empty"):a.removeClass("empty")},1)}),$(document).on("focus",".form-control-wrapper.fileinput",function(){$(this).find("input").addClass("focus")}).on("blur",".form-control-wrapper.fileinput",function(){$(this).find("input").removeClass("focus")}).on("change",".form-control-wrapper.fileinput [type=file]",function(){var a="";$.each($(this)[0].files,function(b,c){console.log(c),a+=c.name+", "}),a=a.substring(0,a.length-2),a?$(this).prev().removeClass("empty"):$(this).prev().addClass("empty"),$(this).prev().val(a)})});
$(function(){"object"==typeof ripples&&ripples.init(".btn:not(.btn-link), .navbar a:not(.withoutripple), .nav-tabs a:not(.withoutripple), .withripple");var a=function(){$(".checkbox > label > input").not(".bs-material").addClass("bs-material").after("<span class=check></span>"),$(".radio > label > input").not(".bs-material").addClass("bs-material").after("<span class=circle></span><span class=check></span>"),$("input.form-control, textarea.form-control, select.form-control").not(".bs-material").each(function(){if(!$(this).is(".bs-material")){if($(this).wrap("<div class=form-control-wrapper></div>"),$(this).after("<span class=material-input></span>"),$(this).hasClass("floating-label")){var a=$(this).attr("placeholder");$(this).attr("placeholder",null).removeClass("floating-label"),$(this).after("<div class=floating-label>"+a+"</div>")}if(($(this).is(":empty")||null===$(this).val()||"undefined"==$(this).val()||""===$(this).val())&&$(this).addClass("empty"),$(this).parent().next().is("[type=file]")){$(this).parent().addClass("fileinput");var b=$(this).parent().next().detach();$(this).after(b)}}})};a();var b=function(){var a,b={animation:"animationend","-o-animation":"oAnimationEnd","-moz-animation":"animationend","-webkit-animation":"webkitAnimationEnd","-ms-animation":"animationend"},c=document.createElement("animatefakeelement");for(a in b)if("undefined"!=typeof c.style[a])return b[a];return null}();document.arrive&&document.arrive("input, textarea, select",function(){a()}),$(document).on("change",".checkbox input",function(){var a=$(this).focus();a.find("+ .check").one(b,function(){a.blur()})}),$(document).on("keyup change",".form-control",function(){var a=$(this);setTimeout(function(){""===a.val()?a.addClass("empty"):a.removeClass("empty")},1)}),$(document).on("focus",".form-control-wrapper.fileinput",function(){$(this).find("input").addClass("focus")}).on("blur",".form-control-wrapper.fileinput",function(){$(this).find("input").removeClass("focus")}).on("change",".form-control-wrapper.fileinput [type=file]",function(){var a="";$.each($(this)[0].files,function(b,c){console.log(c),a+=c.name+", "}),a=a.substring(0,a.length-2),a?$(this).prev().removeClass("empty"):$(this).prev().addClass("empty"),$(this).prev().val(a)})});

View File

@ -39,22 +39,22 @@ $(function (){
// Detect animationend event name.
var ANIMATION_END_EVENT = (function() {
var eventName,
ANIMATION_END_EVENT_NAMES = {
"animation": "animationend",
"-o-animation": "oAnimationEnd",
"-moz-animation": "animationend",
"-webkit-animation": "webkitAnimationEnd",
"-ms-animation": "animationend"
},
animateFakeEl = document.createElement("animatefakeelement");
var eventName,
ANIMATION_END_EVENT_NAMES = {
"animation": "animationend",
"-o-animation": "oAnimationEnd",
"-moz-animation": "animationend",
"-webkit-animation": "webkitAnimationEnd",
"-ms-animation": "animationend"
},
animateFakeEl = document.createElement("animatefakeelement");
for (eventName in ANIMATION_END_EVENT_NAMES) {
if (typeof(animateFakeEl.style[eventName]) !== "undefined") {
return ANIMATION_END_EVENT_NAMES[eventName];
for (eventName in ANIMATION_END_EVENT_NAMES) {
if (typeof(animateFakeEl.style[eventName]) !== "undefined") {
return ANIMATION_END_EVENT_NAMES[eventName];
}
}
}
return null;
return null;
})();
// Support for "arrive.js" to dynamically detect creation of elements
@ -69,7 +69,7 @@ $(function (){
$(document).on("change", ".checkbox input", function() {
// safari cannot auto focus when click.
var $checkbox = $(this).focus();
$checkbox.find("+ .check").one(ANIMATION_END_EVENT, function () {
$checkbox.find("+ .check").one(ANIMATION_END_EVENT, function() {
$checkbox.blur();
});
});

View File

@ -37,23 +37,24 @@ $(function (){
};
initInputs();
// Detect animationend event name.
var ANIMATION_END_EVENT = (function() {
var eventName,
ANIMATION_END_EVENT_NAMES = {
"animation": "animationend",
"-o-animation": "oAnimationEnd",
"-moz-animation": "animationend",
"-webkit-animation": "webkitAnimationEnd",
"-ms-animation": "animationend"
},
animateFakeEl = document.createElement("animatefakeelement");
var eventName,
ANIMATION_END_EVENT_NAMES = {
"animation": "animationend",
"-o-animation": "oAnimationEnd",
"-moz-animation": "animationend",
"-webkit-animation": "webkitAnimationEnd",
"-ms-animation": "animationend"
},
animateFakeEl = document.createElement("animatefakeelement");
for (eventName in ANIMATION_END_EVENT_NAMES) {
if (typeof(animateFakeEl.style[eventName]) !== "undefined") {
return ANIMATION_END_EVENT_NAMES[eventName];
for (eventName in ANIMATION_END_EVENT_NAMES) {
if (typeof(animateFakeEl.style[eventName]) !== "undefined") {
return ANIMATION_END_EVENT_NAMES[eventName];
}
}
}
return null;
return null;
})();
// Support for "arrive.js" to dynamically detect creation of elements
@ -68,8 +69,7 @@ $(function (){
$(document).on("change", ".checkbox input", function() {
// safari cannot auto focus when click.
var $checkbox = $(this).focus();
$(":before", this).one(ANIMATION_END_EVENT, function () {
console.log(ANIMATION_END_EVENT);
$checkbox.find("+ .check").one(ANIMATION_END_EVENT, function () {
$checkbox.blur();
});
});

View File

@ -1 +1 @@
$(function(){"object"==typeof ripples&&ripples.init(".btn:not(.btn-link), .navbar a:not(.withoutripple), .nav-tabs a:not(.withoutripple), .withripple");var a=function(){$(".checkbox > label > input").not(".bs-material").addClass("bs-material").after("<span class=check></span>"),$(".radio > label > input").not(".bs-material").addClass("bs-material").after("<span class=circle></span><span class=check></span>"),$("input.form-control, textarea.form-control, select.form-control").not(".bs-material").each(function(){if(!$(this).is(".bs-material")){if($(this).wrap("<div class=form-control-wrapper></div>"),$(this).after("<span class=material-input></span>"),$(this).hasClass("floating-label")){var a=$(this).attr("placeholder");$(this).attr("placeholder",null).removeClass("floating-label"),$(this).after("<div class=floating-label>"+a+"</div>")}if(($(this).is(":empty")||null===$(this).val()||"undefined"==$(this).val()||""===$(this).val())&&$(this).addClass("empty"),$(this).parent().next().is("[type=file]")){$(this).parent().addClass("fileinput");var b=$(this).parent().next().detach();$(this).after(b)}}})};a();var b=function(){var a,b={animation:"animationend","-o-animation":"oAnimationEnd","-moz-animation":"animationend","-webkit-animation":"webkitAnimationEnd","-ms-animation":"animationend"},c=document.createElement("animatefakeelement");for(a in b)if("undefined"!=typeof c.style[a])return b[a];return null}();document.arrive&&document.arrive("input, textarea, select",function(){a()}),$(document).on("change",".checkbox input",function(){var a=$(this).focus();a.find("+ .check").one(b,function(){console.log(b),a.blur()})}),$(document).on("keyup change",".form-control",function(){var a=$(this);setTimeout(function(){""===a.val()?a.addClass("empty"):a.removeClass("empty")},1)}),$(document).on("focus",".form-control-wrapper.fileinput",function(){$(this).find("input").addClass("focus")}).on("blur",".form-control-wrapper.fileinput",function(){$(this).find("input").removeClass("focus")}).on("change",".form-control-wrapper.fileinput [type=file]",function(){var a="";$.each($(this)[0].files,function(b,c){console.log(c),a+=c.name+", "}),a=a.substring(0,a.length-2),a?$(this).prev().removeClass("empty"):$(this).prev().addClass("empty"),$(this).prev().val(a)})});
$(function(){"object"==typeof ripples&&ripples.init(".btn:not(.btn-link), .navbar a:not(.withoutripple), .nav-tabs a:not(.withoutripple), .withripple");var a=function(){$(".checkbox > label > input").not(".bs-material").addClass("bs-material").after("<span class=check></span>"),$(".radio > label > input").not(".bs-material").addClass("bs-material").after("<span class=circle></span><span class=check></span>"),$("input.form-control, textarea.form-control, select.form-control").not(".bs-material").each(function(){if(!$(this).is(".bs-material")){if($(this).wrap("<div class=form-control-wrapper></div>"),$(this).after("<span class=material-input></span>"),$(this).hasClass("floating-label")){var a=$(this).attr("placeholder");$(this).attr("placeholder",null).removeClass("floating-label"),$(this).after("<div class=floating-label>"+a+"</div>")}if(($(this).is(":empty")||null===$(this).val()||"undefined"==$(this).val()||""===$(this).val())&&$(this).addClass("empty"),$(this).parent().next().is("[type=file]")){$(this).parent().addClass("fileinput");var b=$(this).parent().next().detach();$(this).after(b)}}})};a();var b=function(){var a,b={animation:"animationend","-o-animation":"oAnimationEnd","-moz-animation":"animationend","-webkit-animation":"webkitAnimationEnd","-ms-animation":"animationend"},c=document.createElement("animatefakeelement");for(a in b)if("undefined"!=typeof c.style[a])return b[a];return null}();document.arrive&&document.arrive("input, textarea, select",function(){a()}),$(document).on("change",".checkbox input",function(){var a=$(this).focus();a.find("+ .check").one(b,function(){a.blur()})}),$(document).on("keyup change",".form-control",function(){var a=$(this);setTimeout(function(){""===a.val()?a.addClass("empty"):a.removeClass("empty")},1)}),$(document).on("focus",".form-control-wrapper.fileinput",function(){$(this).find("input").addClass("focus")}).on("blur",".form-control-wrapper.fileinput",function(){$(this).find("input").removeClass("focus")}).on("change",".form-control-wrapper.fileinput [type=file]",function(){var a="";$.each($(this)[0].files,function(b,c){console.log(c),a+=c.name+", "}),a=a.substring(0,a.length-2),a?$(this).prev().removeClass("empty"):$(this).prev().addClass("empty"),$(this).prev().val(a)})});