Skip to content

Commit

Permalink
added more demos to documentation, removed icon in dummy loading text
Browse files Browse the repository at this point in the history
  • Loading branch information
vakata committed Dec 25, 2013
1 parent 7535232 commit 8554ee1
Show file tree
Hide file tree
Showing 10 changed files with 503 additions and 237 deletions.
2 changes: 1 addition & 1 deletion dist/jstree.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@
return this.nodeType === 3 && (!this.nodeValue || /^\s+$/.test(this.nodeValue));
})
.remove();
this.element.html("<"+"ul class='jstree-container-ul'><"+"li class='jstree-initial-node jstree-loading jstree-leaf jstree-last'><i class='jstree-icon jstree-ocl'></i><"+"a class='jstree-anchor' href='#'><i class='jstree-icon jstree-loading-icon'></i>" + this.get_string("Loading ...") + "</a></li></ul>");
this.element.html("<"+"ul class='jstree-container-ul'><"+"li class='jstree-initial-node jstree-loading jstree-leaf jstree-last'><i class='jstree-icon jstree-ocl'></i><"+"a class='jstree-anchor' href='#'><i class='jstree-icon jstree-themeicon-hidden'></i>" + this.get_string("Loading ...") + "</a></li></ul>");
this._data.core.li_height = this.get_container_ul().children("li:eq(0)").height() || 18;
/**
* triggered after the loading text is shown and before loading starts
Expand Down
4 changes: 2 additions & 2 deletions dist/jstree.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/ajax_children.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["Child 1","Child 2"]
4 changes: 4 additions & 0 deletions docs/ajax_nodes.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<ul>
<li>Node 1</li>
<li class="jstree-closed">Node 2</li>
</ul>
4 changes: 4 additions & 0 deletions docs/ajax_roots.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
{ "text" : "Root 1", "children" : true },
{ "text" : "Root 2", "children" : true }
]
12 changes: 12 additions & 0 deletions docs/assets/docs.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ h3 { text-align:left; color:#73796B; font-family:Georgia, serif; font-style:ital
h3 > i { font-size:0.6em; }
h4 { margin-top:1em; }

#docs .nav {
margin:0 -15px 1em -15px; font-size:1.2em; padding-left:25px; text-align:center;
background-image: -webkit-gradient(linear, 0 100%, 0 0, from(#eee), color-stop(0.6, #fff));
background-image: -webkit-linear-gradient(bottom, #eee, #fff 60%);
background-image: -moz-linear-gradient(bottom, #eee, #fff 60%);
background-image: -o-linear-gradient(bottom, #eee, #fff 60%);
background-image: linear-gradient(bottom, #eee, #fff 60%);
}
#docs h3 { margin-left:-15px; margin-right:-15px; padding-left:25px; }

.spaced > li { margin-bottom:1.8em; }

.item { padding:12px 10px 0 10px; margin-bottom:10px; border-radius:5px; border:1px solid #eee; }
.item > .item-inner { display:none; }
.item:nth-child(2n) { background:#fcfcfc; }
Expand Down
23 changes: 9 additions & 14 deletions docs/assets/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ $(function () {
},50);
});

$('.tab-content').children().hide().eq(0).show();
$('.nav a').on('click', function () { $(this).blur(); })

$.address
//.state(window.location.protocol + '//' + window.location.host + window.location.pathname.replace(/^(.*?\/docs\/).*$/ig, '$1'))
.init(function(e) {
Expand All @@ -55,7 +58,12 @@ $(function () {
cont.find('.item').show();
elem = e.pathNames[1] ? cont.find('#' + e.pathNames[1]) : [];
if(elem.length) {
elem[0].scrollIntoView();
if(elem.hasClass('tab-content-item')) {
elem.siblings().hide().end().show().parent().prev().children().removeClass('active').eq(elem.index()).addClass('active');
}
else {
elem[0].scrollIntoView();
}
}
else {
//document.documentElement.scrollTop = 0;
Expand Down Expand Up @@ -192,17 +200,4 @@ $(function () {
"And wholerow selection"
]
}});
$('#docs .list-group-item')
.on('mouseenter', function () {
var i = $(this).index();
if(i) {
$('pre .point').css('backgroundColor', 'transparent').eq(i-1).css('backgroundColor','#D9E3CB');
}
})
.on('mouseleave', function () {
var i = $(this).index();
if(i) {
$('pre .point').eq(i-1).css('backgroundColor','transparent');
}
});
});
686 changes: 468 additions & 218 deletions docs/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/jstree.json
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@
},
"isPrivate": false,
"ignore": false,
"code": "this.trigger(\"init\");\n\n\t\t\tthis._data.core.original_container_html = this.element.find(\" > ul > li\").clone(true);\n\t\t\tthis._data.core.original_container_html\n\t\t\t\t.find(\"li\").addBack()\n\t\t\t\t.contents().filter(function() {\n\t\t\t\t\treturn this.nodeType === 3 && (!this.nodeValue || /^\\s+$/.test(this.nodeValue));\n\t\t\t\t})\n\t\t\t\t.remove();\n\t\t\tthis.element.html(\"<\"+\"ul class='jstree-container-ul'><\"+\"li class='jstree-initial-node jstree-loading jstree-leaf jstree-last'><i class='jstree-icon jstree-ocl'></i><\"+\"a class='jstree-anchor' href='#'><i class='jstree-icon jstree-loading-icon'></i>\" + this.get_string(\"Loading ...\") + \"</a></li></ul>\");\n\t\t\tthis._data.core.li_height = this.get_container_ul().children(\"li:eq(0)\").height() || 18;"
"code": "this.trigger(\"init\");\n\n\t\t\tthis._data.core.original_container_html = this.element.find(\" > ul > li\").clone(true);\n\t\t\tthis._data.core.original_container_html\n\t\t\t\t.find(\"li\").addBack()\n\t\t\t\t.contents().filter(function() {\n\t\t\t\t\treturn this.nodeType === 3 && (!this.nodeValue || /^\\s+$/.test(this.nodeValue));\n\t\t\t\t})\n\t\t\t\t.remove();\n\t\t\tthis.element.html(\"<\"+\"ul class='jstree-container-ul'><\"+\"li class='jstree-initial-node jstree-loading jstree-leaf jstree-last'><i class='jstree-icon jstree-ocl'></i><\"+\"a class='jstree-anchor' href='#'><i class='jstree-icon jstree-themeicon-hidden'></i>\" + this.get_string(\"Loading ...\") + \"</a></li></ul>\");\n\t\t\tthis._data.core.li_height = this.get_container_ul().children(\"li:eq(0)\").height() || 18;"
},
{
"tags": [
Expand Down
2 changes: 1 addition & 1 deletion src/jstree.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@
return this.nodeType === 3 && (!this.nodeValue || /^\s+$/.test(this.nodeValue));
})
.remove();
this.element.html("<"+"ul class='jstree-container-ul'><"+"li class='jstree-initial-node jstree-loading jstree-leaf jstree-last'><i class='jstree-icon jstree-ocl'></i><"+"a class='jstree-anchor' href='#'><i class='jstree-icon jstree-loading-icon'></i>" + this.get_string("Loading ...") + "</a></li></ul>");
this.element.html("<"+"ul class='jstree-container-ul'><"+"li class='jstree-initial-node jstree-loading jstree-leaf jstree-last'><i class='jstree-icon jstree-ocl'></i><"+"a class='jstree-anchor' href='#'><i class='jstree-icon jstree-themeicon-hidden'></i>" + this.get_string("Loading ...") + "</a></li></ul>");
this._data.core.li_height = this.get_container_ul().children("li:eq(0)").height() || 18;
/**
* triggered after the loading text is shown and before loading starts
Expand Down

0 comments on commit 8554ee1

Please sign in to comment.