@progress/kendo-angular-common
Version:
Kendo UI for Angular - Utility Package
17 lines (16 loc) • 848 B
JavaScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2020 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
;
Object.defineProperty(exports, "__esModule", { value: true });
var closest_1 = require("./closest");
exports.contains = function (parent, node, matchSelf) {
if (matchSelf === void 0) { matchSelf = false; }
var outside = !closest_1.closest(node, function (child) { return child === parent; });
if (outside) {
return false;
}
var el = closest_1.closest(node, function (child) { return child === node; });
return el && (matchSelf || el !== parent);
};