All Downloads are FREE. Search and download functionalities are using the official Maven repository.

.selenide-core.7.4.1.source-code.dblclick.js Maven / Gradle / Ivy

There is a newer version: 7.6.1
Show newest version
(function (element, offsetX, offsetY) {
  const rect = element.getBoundingClientRect();

  function mouseEvent() {
    if (typeof (Event) === 'function') {
      return new MouseEvent('dblclick', {
        'view': window,
        'bubbles': true,
        'cancelable': true,
        'clientX': rect.left + rect.width / 2 + offsetX,
        'clientY': rect.top + rect.height / 2 + offsetY
      });
    }
    else {
      const event = document.createEvent('MouseEvent');
      event.initEvent('dblclick', true, true);
      event.type = 'dblclick'
      event.view = window;
      event.clientX = rect.left + rect.width / 2 + offsetX
      event.clientY = rect.top + rect.height / 2 + offsetY
      return event;
    }
  }
  element.dispatchEvent(mouseEvent());
})(arguments[0], arguments[1], arguments[2]);




© 2015 - 2025 Weber Informatics LLC | Privacy Policy