From dd5519dc15f56d44abe38b6454a5034db4800585 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Fri, 16 Mar 2012 17:27:42 -0700 Subject: fix for IKNINJA-1357 - Cannot create other file types such as css, json from the New file dialog box. Signed-off-by: Ananya Sen --- .../ui/tree-basic/treeItem.reel/treeItem.js | 35 ++++++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'js/components/ui') diff --git a/js/components/ui/tree-basic/treeItem.reel/treeItem.js b/js/components/ui/tree-basic/treeItem.reel/treeItem.js index a67dad43..13e278e9 100755 --- a/js/components/ui/tree-basic/treeItem.reel/treeItem.js +++ b/js/components/ui/tree-basic/treeItem.reel/treeItem.js @@ -107,8 +107,8 @@ exports.TreeItem = Montage.create(Component, { //icon or text click sends selection event var contentEls = this.element.querySelectorAll(".atreeItemContent"); for(var i=0;i" + "Modified date: "+ this.formatTimestamp(this.treeItemData.modifiedDate);} if((this.treeItemData.type === "directory") && (this.expandAfterDraw === true)){ - this.toggleContent(this.treeArrow); + this.expand(this.treeArrow); } if(this.treeItemData.uri === this.highlightedUri){ this.itemName.classList.add("selected"); @@ -171,6 +171,35 @@ exports.TreeItem = Montage.create(Component, { } }, + expand:{ + writable:false, + enumerable:true, + value:function(el){ + //if children already drawn then just hide/show + if(this.element.getElementsByTagName("ul").length > 0){ + var theParent = this.element.getElementsByTagName("ul")[0].parentNode; + if(theParent.classList.contains("hideTree")){//collapsed + theParent.classList.remove("hideTree");//expand + el.innerHTML = "▼"; + } + } + //else send event to draw the children + else{ + var treeClickEvent = document.createEvent("Events"); + treeClickEvent.initEvent("drawTree", false, false); + treeClickEvent.uri = this.treeItemData.uri; + treeClickEvent.uriType = this.treeItemData.type; + var divEl = document.createElement("div"); + this.element.appendChild(divEl); + treeClickEvent.subTreeContainer = divEl; + this.element.dispatchEvent(treeClickEvent); + + el.innerHTML = "▼"; + } + } + }, + + /** * Event Listeners */ -- cgit v1.2.3 From 50ee8428d398d2a5f21f4d642642ba85d7df3e5e Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Mon, 19 Mar 2012 13:51:31 -0700 Subject: Replacing old button component with montage button component in our UI. Signed-off-by: Nivesh Rajbhandari --- js/components/ui/property-control.reel/property-control.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/components/ui') diff --git a/js/components/ui/property-control.reel/property-control.js b/js/components/ui/property-control.reel/property-control.js index 58b1be9f..cd59c02c 100755 --- a/js/components/ui/property-control.reel/property-control.js +++ b/js/components/ui/property-control.reel/property-control.js @@ -9,7 +9,7 @@ var Montage = require("montage/core/core").Montage, HotText = require("js/components/hottext.reel").HotText, HotTextUnit = require("js/components/hottextunit.reel").HotTextUnit, Slider = require("js/components/slider.reel").Slider, - Button = require("js/components/button.reel").Button, + Button = require("montage/ui/button.reel").Button, Checkbox = require("js/components/checkbox.reel").Checkbox, Combobox = require("js/components/combobox.reel").Combobox, TextField = require("js/components/TextField.reel").TextField, -- cgit v1.2.3