define(() => {
    (function () {
        let $document = $(document);
        let $wrapper = $('.works-wrapper');
        let $sider = $('.works-sider');
        $sider.bind('click', function (event) {
            event.stopPropagation();
        });
        this.bind('click', function (event) {
            event.stopPropagation();
            let $this = $(this);
            if ($sider.hasClass('works-sider-active')) {
                $sider.removeClass('works-sider-active');
                $wrapper.removeClass('works-sider-active');
                $document.unbind('click.worksMenuHandler');
            } else {
                $sider.addClass('works-sider-active');
                $wrapper.addClass('works-sider-active');
                $document.unbind('click.worksMenuHandler').bind('click.worksMenuHandler', function (event) {
                    event.preventDefault();
                    $sider.removeClass('works-sider-active');
                    $wrapper.removeClass('works-sider-active');
                    $document.unbind('click.worksMenuHandler');
                });
            }
        });
    }).hook('menu', null, {
        nativeElement: '<button></button>'
    });
});