diff options
Diffstat (limited to 'js/panels/Materials/materials-library-panel.reel')
-rwxr-xr-x | js/panels/Materials/materials-library-panel.reel/materials-library-panel.html | 13 | ||||
-rwxr-xr-x | js/panels/Materials/materials-library-panel.reel/materials-library-panel.js | 16 |
2 files changed, 18 insertions, 11 deletions
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 b5d7a869..6fa54495 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 | |||
@@ -13,7 +13,8 @@ | |||
13 | "addButton": { | 13 | "addButton": { |
14 | "prototype": "montage/ui/button.reel", | 14 | "prototype": "montage/ui/button.reel", |
15 | "properties": { | 15 | "properties": { |
16 | "element": {"#": "ml_add_btn"} | 16 | "element": {"#": "ml_add_btn"}, |
17 | "enabled": false | ||
17 | }, | 18 | }, |
18 | "listeners": [ | 19 | "listeners": [ |
19 | { | 20 | { |
@@ -25,8 +26,9 @@ | |||
25 | "copyButton": { | 26 | "copyButton": { |
26 | "prototype": "montage/ui/button.reel", | 27 | "prototype": "montage/ui/button.reel", |
27 | "properties": { | 28 | "properties": { |
28 | "element": {"#": "ml_copy_btn"} | 29 | "element": {"#": "ml_copy_btn"}, |
29 | }, | 30 | "enabled": false |
31 | }, | ||
30 | "listeners": [ | 32 | "listeners": [ |
31 | { | 33 | { |
32 | "type": "action", | 34 | "type": "action", |
@@ -37,8 +39,9 @@ | |||
37 | "deleteButton": { | 39 | "deleteButton": { |
38 | "prototype": "montage/ui/button.reel", | 40 | "prototype": "montage/ui/button.reel", |
39 | "properties": { | 41 | "properties": { |
40 | "element": {"#": "ml_delete_btn"} | 42 | "element": {"#": "ml_delete_btn"}, |
41 | }, | 43 | "enabled": false |
44 | }, | ||
42 | "listeners": [ | 45 | "listeners": [ |
43 | { | 46 | { |
44 | "type": "action", | 47 | "type": "action", |
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 2176c6d5..cf0d4e93 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 | |||
@@ -51,14 +51,15 @@ exports.MaterialsLibraryPanel = Montage.create(Component, { | |||
51 | 51 | ||
52 | handleNodeActivation: { | 52 | handleNodeActivation: { |
53 | value:function(obj) { | 53 | value:function(obj) { |
54 | this._showMaterialPopup(obj.id); | 54 | this._showMaterialPopup({ materialId: obj.id }); |
55 | } | 55 | } |
56 | }, | 56 | }, |
57 | 57 | ||
58 | handleShowMaterialPopup: { | 58 | handleShowMaterialPopup: { |
59 | enumerable: false, | 59 | enumerable: false, |
60 | value: function (event) { | 60 | value: function (event) { |
61 | this._showMaterialPopup(event.detail.materialId); | 61 | //this._showMaterialPopup(event.detail.materialId); |
62 | this._showMaterialPopup(event.detail); | ||
62 | } | 63 | } |
63 | }, | 64 | }, |
64 | 65 | ||
@@ -68,14 +69,15 @@ exports.MaterialsLibraryPanel = Montage.create(Component, { | |||
68 | }, | 69 | }, |
69 | 70 | ||
70 | _materialInfo: { | 71 | _materialInfo: { |
71 | enumerable:true | 72 | enumerable:true, |
73 | serializable: true | ||
72 | }, | 74 | }, |
73 | 75 | ||
74 | _showMaterialPopup: { | 76 | _showMaterialPopup: { |
75 | enumerable: false, | 77 | enumerable: false, |
76 | value: function (materialID) { | 78 | value: function (materialObj) { |
77 | 79 | ||
78 | if(!this._materialPopup) | 80 | if(!this._materialPopup) |
79 | { | 81 | { |
80 | this._materialPopup = Popup.create(); | 82 | this._materialPopup = Popup.create(); |
81 | this._materialPopup.content = this._materialInfo; | 83 | this._materialPopup.content = this._materialInfo; |
@@ -84,7 +86,9 @@ exports.MaterialsLibraryPanel = Montage.create(Component, { | |||
84 | this._materialPopup.addEventListener("show", this, false); | 86 | this._materialPopup.addEventListener("show", this, false); |
85 | } | 87 | } |
86 | this._materialPopup.show(); | 88 | this._materialPopup.show(); |
87 | this._materialInfo.loadMaterials(materialID); | 89 | |
90 | materialID = materialObj.materialId; | ||
91 | this._materialInfo.loadMaterials(materialID, materialObj.useSelection, materialObj.whichMaterial); | ||
88 | } | 92 | } |
89 | }, | 93 | }, |
90 | 94 | ||