`
timnity
  • 浏览: 103597 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

jsTree 0.9.9a的一个bug

阅读更多
今天用了下jstree,版本是0.9.9a,结果发现无法设置theme_path,导致必须把jquery.tree.js和themes文件夹放一起,不能自定义路径。查看了一下jquery.tree.js的代码,在209行出错了。
if(this.settings.ui.theme_path === false) {
  $("script").each(function () {					
    ……
  });
}

这个if完了以后,没有else,也就是如果设置了theme_path,是根本不处理的,这肯定是个bug,google了一下,googlegroups里作者说在0.9.9b里面会解决……汗,最近好像是圣诞假期,谁知道你是不是在冰岛泡温泉着呢,自己改改吧:
if(this.settings.ui.theme_path === false) {
  $("script").each(function () {					
    ……
  });
} else {
  this.settings.ui.theme_path +=  this.settings.ui.theme_name + "/style.css";
}

这样就可以了
分享到:
评论
2 楼 qipei 2010-01-12  
按照一楼的 直接设置到相应主题的style.css 就可以了

但是按api来看 算是个Bug
1 楼 drain 2010-01-05  
不是可以设置吗?我最近也在使用jstree
$(function () {
            $("#demo_1").tree({
                               ui:{
                    theme_path:"js/jstree/themes/default/style.css",
                    theme_name:"default"
                }
                            });
        });

相关推荐

Global site tag (gtag.js) - Google Analytics