aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-29 11:43:55 -0700
committerValerio Virgillito2012-05-29 11:43:55 -0700
commit4fa08fe2ce439a5f5c248c568f72d3828ee11b36 (patch)
tree3fb2977a349c01c5b8cdbd2ab686a0099e3c3999
parent0c9c719acb9381e147b90abbf733ad7eb3beb7f7 (diff)
downloadninja-4fa08fe2ce439a5f5c248c568f72d3828ee11b36.tar.gz
fix for the document tab close button and rulers on initial document
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
-rwxr-xr-xjs/components/layout/document-entry.reel/close_button.gifbin139 -> 0 bytes
-rwxr-xr-xjs/components/layout/document-entry.reel/document-entry.css8
-rwxr-xr-xjs/components/layout/document-entry.reel/document-entry.html15
-rwxr-xr-xjs/components/layout/document-entry.reel/document-entry.js37
-rwxr-xr-xjs/controllers/selection-controller.js40
-rwxr-xr-xjs/ninja.reel/ninja.html3
-rwxr-xr-xjs/stage/stage.reel/stage.js6
7 files changed, 24 insertions, 85 deletions
</
diff --git a/js/components/layout/document-entry.reel/close_button.gif b/js/components/layout/document-entry.reel/close_button.gif
deleted file mode 100755
index 00b5904b..00000000
--- a/js/components/layout/document-entry.reel/close_button.gif
+++ /dev/null
Binary files differ
diff --git a/js/components/layout/document-entry.reel/document-entry.css b/js/components/layout/document-entry.reel/document-entry.css
index 010e1da7..6a2900be 100755
--- a/js/components/layout/document-entry.reel/document-entry.css
+++ b/js/components/layout/document-entry.reel/document-entry.css
@@ -19,17 +19,13 @@
19 min-width:0px; 19 min-width:0px;
20} 20}
21 21
22.mybutton { 22.documentCloseButton {
23 display: inline; 23 display: inline;
24 -webkit-appearance: none; 24 -webkit-appearance: none;
25 outline: none; 25 outline: none;
26
27 font-size: 9px;
28 cursor: pointer; 26 cursor: pointer;
29 border: 0px; 27 border: 0px;
30 background-color: #474747; 28 background: #474747 url(../../../../images/documentsTab/close_button.gif) center center no-repeat;
31 background-image: -webkit-linear-gradient(top, #505050 0%, #3c3c3c 100%);
32
33} 29}
34 30
35.documentEntry button { 31.documentEntry button {
diff --git a/js/components/layout/document-entry.reel/document-entry.html b/js/components/layout/document-entry.reel/document-entry.html
index bd8c25cb..e68d17c5 100755
--- a/js/components/layout/document-entry.reel/document-entry.html
+++ b/js/components/layout/document-entry.reel/document-entry.html
@@ -22,8 +22,16 @@
22 "closeButton": { 22 "closeButton": {
23 "prototype": "montage/ui/button.reel", 23 "prototype": "montage/ui/button.reel",
24 "properties": { 24 "properties": {
25 "element": {"#": "close-btn"} 25 "element": {"#": "close-btn"},
26 } 26 "identifier": "closeButton"
27 },
28 "listeners": [
29 {
30 "type": "action",
31 "listener": {"@": "owner"},
32 "capture": false
33 }
34 ]
27 } 35 }
28 } 36 }
29 </script> 37 </script>
@@ -31,8 +39,7 @@
31 <body> 39 <body>
32 <li data-montage-id="documentEntry" class="documentEntry"> 40 <li data-montage-id="documentEntry" class="documentEntry">
33 <span data-montage-id="name"></span> 41 <span data-montage-id="name"></span>
34 <!--<img src="js/components/layout/document-entry.reel/close_button.gif" data-montage-id="close-btn">--> 42 <button type="button" class="documentCloseButton" data-montage-id="close-btn"></button>
35 <button type="button" class="mybutton" data-montage-id="close-btn"></button>
36 </li> 43 </li>
37 </body> 44 </body>
38</html> \ No newline at end of file 45</html> \ No newline at end of file
diff --git a/js/components/layout/document-entry.reel/document-entry.js b/js/components/layout/document-entry.reel/document-entry.js
index 2e66c7cd..34e307cb 100755
--- a/js/components/layout/document-entry.reel/document-entry.js
+++ b/js/components/layout/document-entry.reel/document-entry.js
@@ -9,15 +9,11 @@ var Component = require("montage/ui/component").Component;
9 9
10exports.DocumentEntry = Montage.create(Component, { 10exports.DocumentEntry = Montage.create(Component, {
11 11
12 dirty: { value: null },
13
14 _uuid: { 12 _uuid: {
15 value: null, 13 value: null
16 enumerable: false
17 }, 14 },
18 15
19 _document: { 16 _document: {
20 enumerable: false,
21 value: null 17 value: null
22 }, 18 },
23 19
@@ -40,7 +36,9 @@ exports.DocumentEntry = Montage.create(Component, {
40 } 36 }
41 }, 37 },
42 38
43 _name: { value: null }, 39 _name: {
40 value: null
41 },
44 42
45 name: { 43 name: {
46 enumerable: false, 44 enumerable: false,
@@ -74,22 +72,11 @@ exports.DocumentEntry = Montage.create(Component, {
74 } 72 }
75 }, 73 },
76 74
77 prepareForDraw: {
78 enumerable: false,
79 value: function() {
80// this.element.addEventListener("click", this, false);
81// this.closeBtn.addEventListener("click", this, true);
82 }
83 },
84
85
86 draw: { 75 draw: {
87 enumerable: false, 76 enumerable: false,
88 value: function() { 77 value: function() {
89 this.label.innerText = this._name ? this._name : ""; 78 this.label.innerText = this._name ? this._name : "";
90 79
91// this._active ? this.element.classList.add("activeTab") : this.element.classList.remove("activeTab");
92
93 if(this.saveFlag) { 80 if(this.saveFlag) {
94 this.label.classList.add("dirty"); 81 this.label.classList.add("dirty");
95 } else { 82 } else {
@@ -98,19 +85,9 @@ exports.DocumentEntry = Montage.create(Component, {
98 } 85 }
99 }, 86 },
100 87
101 captureClick: { 88 handleCloseButtonAction: {
102 value: function(event) { 89 value: function() {
103 console.log("clicked on the X"); 90 //this.application.ninja.documentController.closeFile(this.application.ninja.documentController._findDocumentByUUID(this._uuid));
104 event.preventDefault();
105 event.stopImmediatePropagation();
106 event.stopPropagation();
107// if(event._event.target.nodeName === "IMG") {
108// this.application.ninja.documentController.closeFile(this.application.ninja.documentController._findDocumentByUUID(this._uuid));
109// } else {
110// if(!this.active) {
111// this.application.ninja.documentController.switchDocuments(this.application.ninja.currentDocument, this.application.ninja.documentController._findDocumentByUUID(this._uuid));
112// }
113// }
114 } 91 }
115 } 92 }
116 93
diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js
index db8bdf51..0d34ff25 100755
--- a/js/controllers/selection-controller.js
+++ b/js/controllers/selection-controller.js
@@ -20,44 +20,7 @@ exports.SelectionController = Montage.create(Component, {
20 } 20 }
21 }, 21 },
22 22
23 _currentDocument: { 23 // Bound property to the ninja currentSelectedContainer
24 value : null,
25 enumerable : false
26 },
27
28 currentDocument : {
29 get : function() {
30 return this._currentDocument;
31 },
32 set : function(value) {
33 if (value === this._currentDocument) {
34 return;
35 }
36
37 this._currentDocument = value;
38
39 if(this._currentDocument.currentView === "design") {
40
41 /*
42 this._isDocument = true;
43
44 if(currentSelectionArray) {
45 this.application.ninja.selectedElements = currentSelectionArray;
46 if(currentSelectionArray.length) {
47 this._isDocument = false;
48 NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument});
49 }
50 }
51
52 this._selectionContainer = this.application.ninja.currentSelectedContainer;
53 */
54 }
55 }
56 },
57
58 /*
59 * Bound property to the ninja currentSelectedContainer
60 */
61 _selectionContainer: { 24 _selectionContainer: {
62 value: null 25 value: null
63 }, 26 },
@@ -77,7 +40,6 @@ exports.SelectionController = Montage.create(Component, {
77 40
78 deserializedFromTemplate: { 41 deserializedFromTemplate: {
79 value: function() { 42 value: function() {
80 this.eventManager.addEventListener("openDocument", this, false);
81 this.eventManager.addEventListener("elementAdded", this, false); 43 this.eventManager.addEventListener("elementAdded", this, false);