Skip to content
Browse files

Allow Test.click() to be usable on xforms:trigger

  • Loading branch information...
1 parent c6ca50f commit bac4755fde9142b190ab746a226397f5e0567e0b @avernet avernet committed Oct 18, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/resources-packaged/ops/javascript/xforms.js
View
4 src/resources-packaged/ops/javascript/xforms.js
@@ -1382,7 +1382,9 @@ var DEFAULT_LOADING_TEXT = "Loading...";
* @return {void}
*/
click: function(id) {
- OD.getElementByTagName(OD.get(id), "button").click();
+ var element = OD.get(id);
+ var button = element.tagName.toLowerCase() == "button" ? element : OD.getElementByTagName(element, "button");
+ button.click();
},
/**

0 comments on commit bac4755

Please sign in to comment.
Something went wrong with that request. Please try again.