UNPKG

@tdallau/nativescript

Version:

some helper functions for nativescript

28 lines 785 B
import { Frame } from "@nativescript/core"; export function getTopUiFrame() { return getParentFrame(Frame.topmost()); } export function getParentFrame(frame) { if (frame && frame.page) { return getParentFrame(frame.page.frame); } else { return frame; } } export function getViewChildrenByClassName(v, className, agg) { if (v.cssClasses.has(className)) { agg.push(v); } v.eachChild(function (vb) { getViewChildrenByClassName(vb, className, agg); return true; }); } export function getElementByClassName(className, topView) { if (topView === void 0) { topView = getTopUiFrame(); } var rtr = []; getViewChildrenByClassName(topView, className, rtr); return rtr; } //# sourceMappingURL=frame.js.map