UNPKG

devextreme

Version:

HTML5 JavaScript Component Suite for Responsive Web Development

30 lines (29 loc) 931 B
/** * DevExtreme (esm/__internal/integration/knockout/utils.js) * Version: 25.2.3 * Build date: Fri Dec 12 2025 * * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ import $ from "../../../core/renderer"; import ko from "knockout"; export const getClosestNodeWithContext = node => { const context = ko.contextFor(node); if (!context && node.parentNode) { return getClosestNodeWithContext(node.parentNode) } return node }; export const getClosestNodeWithKoCreation = node => { const $el = $(node); const data = $el.data(); const hasFlag = null === data || void 0 === data ? void 0 : data.dxKoCreation; if (hasFlag) { return node } if (node.parentNode) { return getClosestNodeWithKoCreation(node.parentNode) } return null };