diff options
author | Valerio Virgillito | 2012-02-15 17:04:39 -0800 |
---|---|---|
committer | Valerio Virgillito | 2012-02-15 17:04:39 -0800 |
commit | fe71cb9aa1700199c0089166ad54fc56eb760644 (patch) | |
tree | b0c7c24b1f45a079e1c09312ca716e3d35aecad4 /js/components/ui/tree-basic/treeItem.reel/treeItem.js | |
parent | 747616980cad14f0b65fbcc7f497ed9680a39d29 (diff) | |
parent | d366c0bd1af6471511217ed574083e15059519b5 (diff) | |
download | ninja-fe71cb9aa1700199c0089166ad54fc56eb760644.tar.gz |
Merge branch 'refs/heads/master' into components
Diffstat (limited to 'js/components/ui/tree-basic/treeItem.reel/treeItem.js')
-rwxr-xr-x[-rw-r--r--] | js/components/ui/tree-basic/treeItem.reel/treeItem.js | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/js/components/ui/tree-basic/treeItem.reel/treeItem.js b/js/components/ui/tree-basic/treeItem.reel/treeItem.js index 4c1c0977..755eab8c 100644..100755 --- a/js/components/ui/tree-basic/treeItem.reel/treeItem.js +++ b/js/components/ui/tree-basic/treeItem.reel/treeItem.js | |||
@@ -29,6 +29,17 @@ exports.TreeItem = Montage.create(Component, { | |||
29 | value:true | 29 | value:true |
30 | }, | 30 | }, |
31 | 31 | ||
32 | expandAfterDraw:{ | ||
33 | writable:true, | ||
34 | enumerable:true, | ||
35 | value:false | ||
36 | }, | ||
37 | highlightedUri:{ | ||
38 | writable:true, | ||
39 | enumerable:true, | ||
40 | value:null | ||
41 | }, | ||
42 | |||
32 | directoryBold :{ | 43 | directoryBold :{ |
33 | writable:true, | 44 | writable:true, |
34 | enumerable:true, | 45 | enumerable:true, |
@@ -85,6 +96,9 @@ exports.TreeItem = Montage.create(Component, { | |||
85 | this.element.identifier = "treeItem"; | 96 | this.element.identifier = "treeItem"; |
86 | this.treeArrow.identifier = "treeArrow"; | 97 | this.treeArrow.identifier = "treeArrow"; |
87 | 98 | ||
99 | this.element.setAttribute("data-uri", this.treeItemData.uri); | ||
100 | this.element.setAttribute("data-type", this.treeItemData.type); | ||
101 | |||
88 | //add arrow click handler for directory | 102 | //add arrow click handler for directory |
89 | if(this.treeItemData.type === "directory"){ | 103 | if(this.treeItemData.type === "directory"){ |
90 | this.treeArrow.addEventListener("click", this, false); | 104 | this.treeArrow.addEventListener("click", this, false); |
@@ -107,7 +121,14 @@ exports.TreeItem = Montage.create(Component, { | |||
107 | if(this.treeItemData.size){this.metadata = this.metadata + "<br />" + "Size: "+this.treeItemData.size;} | 121 | if(this.treeItemData.size){this.metadata = this.metadata + "<br />" + "Size: "+this.treeItemData.size;} |
108 | if(this.treeItemData.creationDate){this.metadata = this.metadata + "<br />" + "Creation date: "+ this.formatTimestamp(this.treeItemData.creationDate);} | 122 | if(this.treeItemData.creationDate){this.metadata = this.metadata + "<br />" + "Creation date: "+ this.formatTimestamp(this.treeItemData.creationDate);} |
109 | if(this.treeItemData.modifiedDate){this.metadata = this.metadata + "<br />" + "Modified date: "+ this.formatTimestamp(this.treeItemData.modifiedDate);} | 123 | if(this.treeItemData.modifiedDate){this.metadata = this.metadata + "<br />" + "Modified date: "+ this.formatTimestamp(this.treeItemData.modifiedDate);} |
110 | } | 124 | |
125 | if((this.treeItemData.type === "directory") && (this.expandAfterDraw === true)){ | ||
126 | this.toggleContent(this.treeArrow); | ||
127 | } | ||
128 | if(this.treeItemData.uri === this.highlightedUri){ | ||
129 | this.itemName.classList.add("selected"); | ||
130 | } | ||
131 | } | ||
111 | }, | 132 | }, |
112 | 133 | ||
113 | toggleContent:{ | 134 | toggleContent:{ |