mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-11 03:16:48 +03:00
28 lines
874 B
JavaScript
28 lines
874 B
JavaScript
'use strict';
|
|
|
|
import {BrowserDomAdapter} from 'angular2/platform/browser';
|
|
BrowserDomAdapter.makeCurrent();
|
|
|
|
/** Gets a child DebugElement by tag name. */
|
|
export function getChildDebugElement(parent, tagName) {
|
|
return parent.query(debugEl => {
|
|
return debugEl.nativeElement.tagName && debugEl.nativeElement.tagName.toLowerCase() === tagName;
|
|
});
|
|
}
|
|
|
|
/** Gets a child DebugElements by tag name. */
|
|
export function getChildDebugElementAll(parent, tagName) {
|
|
return parent.queryAll(debugEl => {
|
|
return debugEl.nativeElement.tagName && debugEl.nativeElement.tagName.toLowerCase() === tagName;
|
|
});
|
|
}
|
|
|
|
export function mouseclick( element ) {
|
|
// create a mouse click event
|
|
var event = document.createEvent( 'MouseEvents' );
|
|
event.initMouseEvent( 'click', true, true, window, 1, 0, 0 );
|
|
|
|
// send click to element
|
|
element.dispatchEvent( event );
|
|
}
|