aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Materials/materials-library-panel.reel/materials-library-panel.js')
-rwxr-xr-xjs/panels/Materials/materials-library-panel.reel/materials-library-panel.js34
1 files changed, 15 insertions, 19 deletions
diff --git a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js
index bb550598..5fd86d00 100755
--- a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js
+++ b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js
@@ -4,29 +4,26 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. 4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5</copyright> */ 5</copyright> */
6 6
7var Tree = require("js/components/tree.reel").Tree, 7var Montage = require("montage/core/core").Montage,
8 MaterialsPopup = require("js/panels/Materials/materials-popup.reel").MaterialsPopup, 8 Component = require("montage/ui/component").Component,
9 PopupMananger = require("js/components/popup-manager.reel").PopupMananger, 9 MaterialsData = require("js/panels/Materials/materials-data.json"),
10 Popup = require("montage/ui/popup/popup.reel").Popup; 10 Popup = require("montage/ui/popup/popup.reel").Popup;
11 11
12exports.MaterialsLibraryPanel = (require("montage/core/core").Montage).create(require("montage/ui/component").Component, { 12exports.MaterialsLibraryPanel = Montage.create(Component, {
13
14 materialsData: {
15 value: null
16 },
13 17
14 _hasFocus: { 18 _hasFocus: {
15 enumerable: false, 19 enumerable: false,
16 value: false 20 value: false
17 }, 21 },
18
19 prepareForDraw: {
20 enumerable: false,
21 value: function() {
22 var treeHolderDiv = document.getElementById("materials_library_tree");
23 var materialsTree = Tree.create();
24 materialsTree.element = treeHolderDiv;
25 materialsTree.dataProvider = this._loadXMLDoc("js/panels/Materials/Materials.xml");
26 materialsTree.needsDraw = true;
27 22
28 materialsTree.addEventListener("change", this, true); 23 didCreate: {
29 } 24 value: function() {
25 this.materialsData = MaterialsData;
26 }
30 }, 27 },
31 28
32 willDraw: { 29 willDraw: {
@@ -71,10 +68,9 @@ exports.MaterialsLibraryPanel = (require("montage/core/core").Montage).create(re
71 } 68 }
72 }, 69 },
73 70
74 captureChange: { 71 handleNodeActivation: {
75 value:function(e) { 72 value:function(obj) {
76 var tNode = e._event.treeNode; 73 this._showMaterialPopup(obj.id);
77 this._showMaterialPopup(tNode.id);
78 } 74 }
79 }, 75 },
80 76