                       var menuWrappers = $(".jqx-menu-wrapper");
                        if (menuWrappers.length === 0) {
                            baseElement.removeClass(LOCK_OPEN);
                        }
                    }
                }

                function onMouseExit(event) {
                    if (baseElement.hasClass(LOCK_OPEN) === false) {
                        baseElement.css("z-index", 0);
                    }
                }

                function onClick(event) {
                    if (event.which === 3) {
                        baseElement.addClass(LOCK_OPEN);
                    } else {
                        baseElement.removeClass(LOCK_OPEN);
                    }
                }

                proxy.addNotification(viewModel.ShowTabNotification, function (data) {
                    // If the bottom panel is collapsed, we must expand it before
                    // moving continuing
                    if (viewModel.id === "BottomPanelTabContainer" && data.focusTab) {
                        expander.trigger('expand');
                    }
                    
                    vm.showTab(element, data.name, data.focusTab);
                });

                proxy.addNotification(viewModel.HideTabNotification, function (name) {
                    vm.hideTab(element, name);
                });

                ko.utils.registerEventHandler(element, "mouseenter", onMouseEnter);
                ko.utils.registerEventHandler(element, "mouseleave", onMouseExit);
                ko.utils.registerEventHandler(element, "mouseup", onClick);

                ko.utils.domNodeDisposal.addDisposeCallback(element, function () {
                    proxy.removeNotification(viewModel.TabVisibilityChangedNotification);
                });
            }
        };
    });