All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.butterfaces-dist-js.butterfaces-treebox.js Maven / Gradle / Ivy

There is a newer version: 3.5.0
Show newest version
var ButterFaces;
(function (ButterFaces) {
    var TreeBox = /** @class */ (function () {
        function TreeBox() {
        }
        TreeBox.removeTrivialTreeDropDown = function (treeBoxId) {
            this.removeTrivialTreeDropDownById(treeBoxId);
            this.removeUnAssociatedTrivialTreeDropDowns();
        };
        TreeBox.removeUnAssociatedTrivialTreeDropDowns = function () {
            var dropdowns = document.querySelectorAll(".tr-dropdown[data-tree-box-id]");
            Array.prototype.slice.call(dropdowns, 0).forEach(function (dropdown) {
                var dropdownId = dropdown.getAttribute("data-tree-box-id");
                if (document.querySelectorAll(".butter-component-treebox[data-tree-box-id=" + dropdownId + "]").length === 0) {
                    dropdown.parentNode.removeChild(dropdown);
                }
            });
        };
        TreeBox.removeTrivialTreeDropDownById = function (treeBoxId) {
            // in jQuery: $(".tr-dropdown[data-tree-box-id=" + treeBoxId + "]").remove();
            // plain javascript:
            var dropdowns = document.querySelectorAll(".tr-dropdown[data-tree-box-id=" + treeBoxId + "]");
            Array.prototype.slice.call(dropdowns, 0).forEach(function (dropdown) {
                dropdown.parentNode.removeChild(dropdown);
            });
        };
        return TreeBox;
    }());
    ButterFaces.TreeBox = TreeBox;
})(ButterFaces || (ButterFaces = {}));

//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJ1dHRlcmZhY2VzLXRyZWVib3gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsSUFBVSxXQUFXLENBOEJwQjtBQTlCRCxXQUFVLFdBQVc7SUFFakI7UUFBQTtRQTBCQSxDQUFDO1FBeEJpQixpQ0FBeUIsR0FBdkMsVUFBd0MsU0FBaUI7WUFDckQsSUFBSSxDQUFDLDZCQUE2QixDQUFDLFNBQVMsQ0FBQyxDQUFDO1lBQzlDLElBQUksQ0FBQyxzQ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CJdXCIpLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBkcm9wZG93bi5wYXJlbnROb2RlLnJlbW92ZUNoaWxkKGRyb3Bkb3duKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIHByaXZhdGUgc3RhdGljIHJlbW92ZVRyaXZpYWxUcmVlRHJvcERvd25CeUlkKHRyZWVCb3hJZDogc3RyaW5nKSB7XG4gICAgICAgICAgICAvLyBpbiBqUXVlcnk6ICQoXCIudHItZHJvcGRvd25bZGF0YS10cmVlLWJveC1pZD1cIiArIHRyZWVCb3hJZCArIFwiXVwiKS5yZW1vdmUoKTtcbiAgICAgICAgICAgIC8vIHBsYWluIGphdmFzY3JpcHQ6XG4gICAgICAgICAgICBjb25zdCBkcm9wZG93bnMgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFwiLnRyLWRyb3Bkb3duW2RhdGEtdHJlZS1ib3gtaWQ9XCIgKyB0cmVlQm94SWQgKyBcIl1cIik7XG4gICAgICAgICAgICBBcnJheS5wcm90b3R5cGUuc2xpY2UuY2FsbChkcm9wZG93bnMsIDApLmZvckVhY2goKGRyb3Bkb3duOiBhbnkpID0+IHtcbiAgICAgICAgICAgICAgICBkcm9wZG93bi5wYXJlbnROb2RlLnJlbW92ZUNoaWxkKGRyb3Bkb3duKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgfVxuXG59Il19




© 2015 - 2024 Weber Informatics LLC | Privacy Policy