Performance and handly usage

This commit is contained in:
Fabrice Daugan 2016-11-06 17:00:05 +01:00 committed by GitHub
parent a16b628109
commit 66864bfb51

View File

@ -256,9 +256,17 @@
}); });
}, },
"ripples": function (selector) { "ripples": function (selector) {
$(document).on('mousedown', selector || this.options.withRipples, function() { if (this.options.ripplesDelegate) {
$(this).ripples(); // Delegate mode, lazy creation
$(document).on('mousedown touchstart', selector || this.options.withRipples, function(event) {
if(!$.data($(this), "plugin_ripples")) {
$(this).ripples({}, event);
}
}); });
} else {
// Immediate and static creation
$((selector) ? selector : this.options.withRipples).ripples();
};
}, },
"autofill": function () { "autofill": function () {
// This part of code will detect autofill when the page is loading (username and password inputs for example) // This part of code will detect autofill when the page is loading (username and password inputs for example)