This repository has been archived on 2025-01-19. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
drupalcampbristol/vendor/jcalderonzumba/mink-phantomjs-driver/src/Resources/Script/is_selected.js.twig

16 lines
414 B
Twig

{% autoescape 'js' %}
(function (xpath) {
function getElement(xpath) {
var polterAgent = window.__poltergeist;
var ids = polterAgent.find("xpath", xpath, document);
var polterNode = polterAgent.get(ids[0]);
return polterNode.element;
}
var node = getElement(xpath);
if(typeof node.selected == "undefined"){
return null;
}
return node.selected;
}('{{xpath}}'));
{% endautoescape %}