aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Materials/materials-library-panel.reel
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Materials/materials-library-panel.reel')
-rwxr-xr-xjs/panels/Materials/materials-library-panel.reel/materials-library-panel.css8
-rwxr-xr-xjs/panels/Materials/materials-library-panel.reel/materials-library-panel.html83
-rwxr-xr-xjs/panels/Materials/materials-library-panel.reel/materials-library-panel.js87
3 files changed, 104 insertions, 74 deletions
diff --git a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.css b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.css
index 07488da1..fe88ebf6 100755
--- a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.css
+++ b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.css
@@ -23,7 +23,7 @@
23 width: 97%; 23 width: 97%;
24} 24}
25 25
26#ml_buttons button { 26#ml_buttons .nj-skinned{
27 height: 22px; 27 height: 22px;
28 overflow: hidden; 28 overflow: hidden;
29 display: block; 29 display: block;
@@ -31,17 +31,17 @@
31 margin: 0px 1px; 31 margin: 0px 1px;
32} 32}
33 33
34#materialsLibraryPanel-ml_add_btn { 34#ml_add_btn {
35 float: left; 35 float: left;
36 width: 60px; 36 width: 60px;
37} 37}
38 38
39#materialsLibraryPanel-ml_copy_btn { 39#ml_copy_btn {
40 float: left; 40 float: left;
41 width: 60px; 41 width: 60px;
42} 42}
43 43
44#materialsLibraryPanel-ml_delete_btn { 44#ml_delete_btn {
45 float: right; 45 float: right;
46 width: 60px; 46 width: 60px;
47} \ No newline at end of file 47} \ No newline at end of file
diff --git a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.html b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.html
index 6ba4ac75..4e41512f 100755
--- a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.html
+++ b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.html
@@ -10,10 +10,75 @@
10 <link rel="stylesheet" type="text/css" href="materials-library-panel.css"> 10 <link rel="stylesheet" type="text/css" href="materials-library-panel.css">
11 <script type="text/montage-serialization"> 11 <script type="text/montage-serialization">
12 { 12 {
13 "materialInfo": { 13 "addButton": {
14 "module": "js/panels/Materials/materials-popup.reel", 14 "prototype": "montage/ui/button.reel",
15 "name": "MaterialsPopup" 15 "properties": {
16 "element": {"#": "ml_add_btn"}
17 },
18 "listeners": [
19 {
20 "type": "action",
21 "listener": {"@": "owner"}
22 }
23 ]
24 },
25 "copyButton": {
26 "prototype": "montage/ui/button.reel",
27 "properties": {
28 "element": {"#": "ml_copy_btn"}
29 },
30 "listeners": [
31 {
32 "type": "action",
33 "listener": {"@": "owner"}
34 }
35 ]
36 },
37 "deleteButton": {
38 "prototype": "montage/ui/button.reel",
39 "properties": {
40 "element": {"#": "ml_delete_btn"}
41 },
42 "listeners": [
43 {
44 "type": "action",
45 "listener": {"@": "owner"}
46 }
47 ]
16 }, 48 },
49 "materialInfo": {
50 "module": "js/panels/Materials/materials-popup.reel",
51 "name": "MaterialsPopup"
52 },
53 "materialsController" : {
54 "module": "js/controllers/tree-controller",
55 "name": "TreeController",
56 "properties" : {
57 "branchKey" : "children",
58 "labelKey" : "label",
59 "delegate": {"@": "owner" }
60 },
61 "bindings": {
62 "content": {
63 "boundObject": {"@": "owner"},
64 "boundObjectPropertyPath": "materialsData"
65 }
66 }
67 },
68 "materialsContainer" : {
69 "module" : "js/components/treeview/treeview.reel",
70 "name" : "Treeview",
71 "properties" : {
72 "element" : {"#": "materials_library_tree"},
73 "branchComponent" : {"@": "branch" },
74 "contentController": {"@": "materialsController"},
75 "showRoot": false
76 }
77 },
78 "branch" : {
79 "module" : "js/components/treeview/ninja-branch.reel",
80 "name" : "Branch"
81 },
17 "owner": { 82 "owner": {
18 "module": "js/panels/Materials/materials-library-panel.reel", 83 "module": "js/panels/Materials/materials-library-panel.reel",
19 "name": "MaterialsLibraryPanels", 84 "name": "MaterialsLibraryPanels",
@@ -29,14 +94,14 @@
29 <body> 94 <body>
30 95
31 <div id="materials_library_panel" class="materials_library_panel"> 96 <div id="materials_library_panel" class="materials_library_panel">
32 <div id="ml_tree_holder"> 97 <section id="ml_tree_holder" class="animationsLibrary">
33 <ul id="materials_library_tree"></ul> 98 <div id="materials_library_tree"></div>
34 </div> 99 </section>
35 <hr /> 100 <hr />
36 <div id="ml_buttons"> 101 <div id="ml_buttons">
37 <button id="ml_add_btn">Add</button> 102 <button id="ml_add_btn" class="nj-skinned">Add</button>
38 <button id="ml_copy_btn">Copy</button> 103 <button id="ml_copy_btn" class="nj-skinned">Copy</button>
39 <button id="ml_delete_btn">Delete</button> 104 <button id="ml_delete_btn" class="nj-skinned">Delete</button>
40 </div> 105 </div>
41 </div> 106 </div>
42 107
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 b16c4376..2176c6d5 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,76 +4,35 @@ 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 Button = require("js/components/button.reel").Button, 8 Component = require("montage/ui/component").Component,
9 MaterialsPopup = require("js/panels/Materials/materials-popup.reel").MaterialsPopup, 9 MaterialsData = require("js/panels/Materials/materials-data.json"),
10 PopupMananger = require("js/components/popup-manager.reel").PopupMananger,
11 Popup = require("montage/ui/popup/popup.reel").Popup; 10 Popup = require("montage/ui/popup/popup.reel").Popup;
12 11
13exports.MaterialsLibraryPanel = (require("montage/core/core").Montage).create(require("montage/ui/component").Component, { 12exports.MaterialsLibraryPanel = Montage.create(Component, {
14 13
15 _hasFocus: { 14 materialsData: {
16 enumerable: false, 15 value: null
17 value: false
18 }, 16 },
19
20 prepareForDraw: {
21 enumerable: false,
22 value: function() {
23 var treeHolderDiv = document.getElementById("materials_library_tree");
24 var materialsTree = Tree.create();
25 materialsTree.element = treeHolderDiv;
26 materialsTree.dataProvider = this._loadXMLDoc("js/panels/Materials/Materials.xml");
27 materialsTree.needsDraw = true;
28
29 materialsTree.addEventListener("change", this, true);
30 17
31 var addButton = Button.create(); 18 _hasFocus: {
32 addButton.element = document.getElementById("ml_add_btn");
33 addButton.label = "Add";
34 addButton.needsDraw = true;
35 addButton.addEventListener("action", this, true);
36
37 var copyButton = Button.create();
38 copyButton.element = document.getElementById("ml_copy_btn");