liuyg
2021-07-02 25ce610f6ecca7325e7a743dc032c4a76559c63d
widgets/LeftNavigationBar/Widget.js
@@ -33,7 +33,7 @@
                // this.begin(this.data);
                var that = this;
                this.getData();
                topic.subscribe("closeNavigation", lang.hitch(this, this.closeNavigation));
                // $('.left-navigation-bar-but').click(() => {
                //     this.changeImg = !this.changeImg;
                //     if (this.changeImg) {
@@ -54,84 +54,39 @@
                //         });
                //     }
                // })
                var time = null;
                $('.left-navigation-bar-but').click(() => {
                    this.changeImg = !this.changeImg;
                    if (this.changeImg) {
                        if (time != null) {
                            clearTimeout(time);
                            time = null;
                $('.left-navigation-bar-but>div').click(() => {
                    topic.publish('closeTool', this.name);
                    topic.publish('closeMap', this.name);
                    $(".jimu-widget-Layermanagement .layer-list").stop().hide();
                    if ($(".jimu-widget-Layermanagement .layer-list").is(":hidden")) {
                        $(".jimu-widget-Layermanagement .tree-layer-opcity").stop().hide();
                        }
                        // $('.l-n-b-b-img').attr("src", "./images/addL/xzuo.png"); //打开
                        $('.left-navigation-bar-main').css({
                            'display': 'block',
                    if ($('.left-navigation-bar-main').is(":hidden")) {
                        $('.left-navigation-bar-main').stop().css({
                            'width': '300px',
                            'padding': '10px',
                            'height': 'auto',
                        });
                        $('.l-n-b-m-search').css({
                            'display': 'flex',
                        })
                        $('#left-tree-list').css({
                            'display': 'block',
                        })
                            'height': 'auto'
                        }).show();
                    } else {
                        // $('.l-n-b-b-img').attr("src", "./images/addL/xyou.png"); //关闭
                        $('.l-n-b-m-search').css({
                            'display': 'none',
                        })
                        $('#left-tree-list').css({
                            'display': 'none',
                        })
                        $('.left-navigation-bar-main').css({
                        $('.left-navigation-bar-main').stop().css({
                            'width': '0px',
                            'padding': '0px',
                            'height': '0px',
                        });
                        if (time != null) {
                            clearTimeout(time);
                            time = null;
                        }).hide();
                        }
                        time = setTimeout(() => {
                            $('.left-navigation-bar-main').css({
                                'display': 'none'
                            });
                            clearTimeout(time);
                            time = null;
                        }, 500);
                    }
                })
                $('#l-n-b-m-search-closeOUR').click(() => {
                    this.changeImg = !this.changeImg;
                    if (!this.changeImg) {
                        if (time != null) {
                            clearTimeout(time);
                            time = null;
                        }
                        $('.l-n-b-m-search').css({
                            'display': 'none',
                        })
                        $('#left-tree-list').css({
                            'display': 'none',
                        })
                        $('.left-navigation-bar-main').css({
                    $('.left-navigation-bar-main').stop().css({
                            'width': '0px',
                            'padding': '0px',
                            'height': '0px',
                        });
                        if (time != null) {
                            clearTimeout(time);
                            time = null;
                        }
                        time = setTimeout(() => {
                            $('.left-navigation-bar-main').css({
                                'display': 'none'
                            });
                            clearTimeout(time);
                            time = null;
                        }, 500);
                    }
                    }).hide();
                })
@@ -238,7 +193,19 @@
                }
            },
            closeToolBox: function (item) { },
            closeNavigation: function (item) {
                if (item != this.name) {
                    if (!$('.left-navigation-bar-main').is(":hidden")) {
                        $('.left-navigation-bar-main').stop().css({
                            'width': '0px',
                            'padding': '0px',
                            'height': '0px',
                        }).hide();
                    }
                }
            },
            onOpen: function () {
                //面板打开的时候触发 (when open this panel trigger)