mirror of
https://github.com/mdbootstrap/mdb-ui-kit.git
synced 2024-11-28 20:44:18 +03:00
Update ripples.js
This commit is contained in:
parent
779902d7eb
commit
4caca986a5
17
dist/js/ripples.js
vendored
17
dist/js/ripples.js
vendored
|
@ -26,7 +26,7 @@
|
|||
/**
|
||||
* Create the main plugin function
|
||||
*/
|
||||
function Ripples(element, options) {
|
||||
function Ripples(element, options, event) {
|
||||
self = this;
|
||||
|
||||
this.element = $(element);
|
||||
|
@ -36,17 +36,16 @@
|
|||
this._defaults = defaults;
|
||||
this._name = ripples;
|
||||
|
||||
this.init();
|
||||
this.init(event);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialize the plugin
|
||||
*/
|
||||
Ripples.prototype.init = function() {
|
||||
Ripples.prototype.init = function(event) {
|
||||
var $element = this.element;
|
||||
|
||||
$element.on("mousedown touchstart", function(event) {
|
||||
var rippleStart = function(event) {
|
||||
/**
|
||||
* Verify if the user is just touching on a device and return if so
|
||||
*/
|
||||
|
@ -142,7 +141,9 @@
|
|||
}
|
||||
});
|
||||
|
||||
});
|
||||
};
|
||||
$element.on("mousedown touchstart", rippleStart);
|
||||
event && rippleStart(event);
|
||||
};
|
||||
|
||||
|
||||
|
@ -313,10 +314,10 @@
|
|||
/**
|
||||
* Create the jquery plugin function
|
||||
*/
|
||||
$.fn.ripples = function(options) {
|
||||
$.fn.ripples = function(options, event) {
|
||||
return this.each(function() {
|
||||
if(!$.data(this, "plugin_" + ripples)) {
|
||||
$.data(this, "plugin_" + ripples, new Ripples(this, options));
|
||||
$.data(this, "plugin_" + ripples, new Ripples(this, options, event));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user