|
|
@@ -50,6 +50,18 @@ $.simulate.prototype.simulateTouchEvent = function(elem, type, options) {
|
|
|
this.dispatchEvent(elem, type, event, options);
|
|
|
};
|
|
|
|
|
|
+$.simulateMouseClick = function(elem) {
|
|
|
+ var $elem = $(elem);
|
|
|
+ var clientCoords = {
|
|
|
+ clientX: $elem.offset().left + $elem.outerWidth() / 2,
|
|
|
+ clientY: $elem.offset().top + $elem.outerHeight() / 2
|
|
|
+ };
|
|
|
+ $elem.simulate('mousemove', clientCoords);
|
|
|
+ $elem.simulate('mousedown', clientCoords);
|
|
|
+ $elem.simulate('mouseup', clientCoords);
|
|
|
+ $elem.simulate('click', clientCoords);
|
|
|
+};
|
|
|
+
|
|
|
$.simulateTouchClick = function(elem) {
|
|
|
var $elem = $(elem);
|
|
|
var clientCoords = {
|