Update jOrgChart and README
parent
4ef470fe9b
commit
57534dcbbb
17
README.md
17
README.md
|
@ -1,6 +1,11 @@
|
||||||
# Jorgchart::Rails
|
# Jorgchart::Rails
|
||||||
|
|
||||||
TODO: Write a gem description
|
jOrgChart for Rails. Bundled up jOrgChart into something useable with the Rails 3.1 asset pipeline
|
||||||
|
|
||||||
|
This gem include my forked version of jOrgChart (https://github.com/gdott9/jOrgChart/tree/my-master) which adds some features waiting to be merged.
|
||||||
|
Additionnal features :
|
||||||
|
* render list with multiple nodes on the first level (https://github.com/wesnolte/jOrgChart/pull/34)
|
||||||
|
* add an option to ignore space used by collapsed nodes (https://github.com/wesnolte/jOrgChart/pull/35)
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
@ -18,7 +23,15 @@ Or install it yourself as:
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
TODO: Write usage instructions here
|
In application.js
|
||||||
|
```
|
||||||
|
//= require jquery.jorgchart
|
||||||
|
```
|
||||||
|
|
||||||
|
This gem comes with a stylesheet for default style. To use it, add the following line in application.css
|
||||||
|
```
|
||||||
|
//= require jquery.jorgchart
|
||||||
|
```
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,8 @@
|
||||||
chartElement : 'body',
|
chartElement : 'body',
|
||||||
depth : -1,
|
depth : -1,
|
||||||
chartClass : "jOrgChart",
|
chartClass : "jOrgChart",
|
||||||
dragAndDrop: false
|
dragAndDrop: false,
|
||||||
|
ignoreSpace: false
|
||||||
};
|
};
|
||||||
|
|
||||||
function buildNodes($list, $appendTo, opts) {
|
function buildNodes($list, $appendTo, opts) {
|
||||||
|
@ -160,7 +161,7 @@
|
||||||
if($tr.hasClass('contracted')){
|
if($tr.hasClass('contracted')){
|
||||||
$this.css('cursor','n-resize');
|
$this.css('cursor','n-resize');
|
||||||
$tr.removeClass('contracted').addClass('expanded');
|
$tr.removeClass('contracted').addClass('expanded');
|
||||||
$tr.nextAll("tr").css('visibility', '');
|
$tr.nextAll("tr").css(opts.ignoreSpace ? 'display' : 'visibility', '');
|
||||||
|
|
||||||
// Update the <li> appropriately so that if the tree redraws collapsed/non-collapsed nodes
|
// Update the <li> appropriately so that if the tree redraws collapsed/non-collapsed nodes
|
||||||
// maintain their appearance
|
// maintain their appearance
|
||||||
|
@ -168,7 +169,8 @@
|
||||||
}else{
|
}else{
|
||||||
$this.css('cursor','s-resize');
|
$this.css('cursor','s-resize');
|
||||||
$tr.removeClass('expanded').addClass('contracted');
|
$tr.removeClass('expanded').addClass('contracted');
|
||||||
$tr.nextAll("tr").css('visibility', 'hidden');
|
if(opts.ignoreSpace) { $tr.nextAll("tr").css('display', 'none'); }
|
||||||
|
else { $tr.nextAll("tr").css('visibility', 'hidden'); }
|
||||||
|
|
||||||
$node.addClass('collapsed');
|
$node.addClass('collapsed');
|
||||||
}
|
}
|
||||||
|
@ -230,7 +232,8 @@
|
||||||
$.each(classList, function(index,item) {
|
$.each(classList, function(index,item) {
|
||||||
if (item == 'collapsed') {
|
if (item == 'collapsed') {
|
||||||
console.log($node);
|
console.log($node);
|
||||||
$nodeRow.nextAll('tr').css('visibility', 'hidden');
|
if(opts.ignoreSpace) { $nodeRow.nextAll('tr').css('display', 'none'); }
|
||||||
|
else { $nodeRow.nextAll('tr').css('visibility', 'hidden'); }
|
||||||
$nodeRow.removeClass('expanded');
|
$nodeRow.removeClass('expanded');
|
||||||
$nodeRow.addClass('contracted');
|
$nodeRow.addClass('contracted');
|
||||||
$nodeDiv.css('cursor','s-resize');
|
$nodeDiv.css('cursor','s-resize');
|
||||||
|
|
Loading…
Reference in New Issue