阅读(1140) (9)

修复部分移动端文件数量显示不全的问题

2023-02-10 12:58:56 更新

文件: dzz\explorer\js\mobile\index.js

修改的代码展示:

//列表加载更多
var scroll_flag = 1//开启状态
_filemanage.loadMore = function () {
    if (_filemanage.datajson.param.page) {
        _filemanage.getData(function (data) {
            if (scroll_flag == 1) {
                $(window).off();
                scroll_flag = 0;
                if (data) {
                    scroll_flag = 1;
                    $(window).scroll(function () {
                        var scrollTop = $(this).scrollTop();
                        var scrollHeight = $(document).height()-80;
                        var clientHeight = $(this).height();
                        if (scrollTop + clientHeight >= scrollHeight) {
                            if (_filemanage.datajson.param.page > 0) {
                                $('#' + _filemanage.contains).append(data);
                                _filemanage.menuSwitch();
                                _filemanage.loadMore();
                            }
                        }
                    });
                } else {
                    scroll_flag = 0;
                }
            }
        });
    }

}