New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

marionette-helper

Package Overview
Dependencies
Maintainers
4
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

marionette-helper - npm Package Compare versions

Comparing version 0.2.2 to 0.3.0

test/integration/closest_test.js

30

index.js

@@ -299,2 +299,32 @@ var Marionette = require('marionette-client');

});
},
/**
* Get the first element that matches the selector by testing the element
* itself and traversing up through its ancestors in the DOM tree.
*
* @param {Marionette.Element|String} el element or some css selector where
* the search should start.
* @param {String} selector A string containing a selector expression to
* match elements against.
* @return {Marionette.Element|undefined} Element found by selector
*/
closest: function(el, selector) {
if (!isElement(el)) {
el = this.client.findElement(el);
}
var result = this.client.executeScript(function(el, selector) {
// HTMLDocument doesn't have mozMatchesSelector and can't be matched
while (el && el !== document.documentElement) {
// XXX: firefox 30 still needs prefix
if (el.mozMatchesSelector(selector)) {
return el;
}
el = el.parentNode;
}
}, [el, selector]);
// executeScript returns "null" by default
return result || undefined;
}

@@ -301,0 +331,0 @@ };

6

package.json
{
"name": "marionette-helper",
"version": "0.2.2",
"version": "0.3.0",
"author": {
"name": "Gareth Aye",
"email": "gaye@mozilla.com"
"name": "The Gaia Team",
"email": "dev-gaia@lists.mozilla.org"
},

@@ -8,0 +8,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc