From a7cb2c0b22f03b79f19d4a9a2eb691d1ccc392f9 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 14 Mar 2012 18:04:11 -0700 Subject: adding a focus manager to handle panel bugs where blur was not getting called when clicking on the canvas. Signed-off-by: Valerio Virgillito --- js/components/focus-manager.reel/focus-manager.js | 49 +++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 js/components/focus-manager.reel/focus-manager.js (limited to 'js/components') diff --git a/js/components/focus-manager.reel/focus-manager.js b/js/components/focus-manager.reel/focus-manager.js new file mode 100644 index 00000000..65a84bc1 --- /dev/null +++ b/js/components/focus-manager.reel/focus-manager.js @@ -0,0 +1,49 @@ +/* + This file contains proprietary software owned by Motorola Mobility, Inc.
+ No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ + +var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component; + +exports.FocusManager = Montage.create(Component, { + + hasTemplate: { + value: false + }, + + element: { + serializable: true, + enumerable: true, + get: function() { + return this._element; + }, + set: function(value) { + // call super set + Object.getPropertyDescriptor(Component, "element").set.call(this, value); + } + }, + + hiddenInput: { + value: null + }, + + prepareForDraw: { + value: function() { + this.hiddenInput = document.createElement("input"); + this.hiddenInput.type = "text"; + + this.element.appendChild(this.hiddenInput); + + } + }, + + setFocus: { + value: function() { + this.hiddenInput.focus(); + } + } + +}); + -- cgit v1.2.3 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') 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') 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