aboutsummaryrefslogtreecommitdiff
path: root/js/components/layout/document-entry.reel/document-entry.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/components/layout/document-entry.reel/document-entry.js')
-rwxr-xr-xjs/components/layout/document-entry.reel/document-entry.js44
1 files changed, 15 insertions, 29 deletions
diff --git a/js/components/layout/document-entry.reel/document-entry.js b/js/components/layout/document-entry.reel/document-entry.js
index 50b3624c..2e66c7cd 100755
--- a/js/components/layout/document-entry.reel/document-entry.js
+++ b/js/components/layout/document-entry.reel/document-entry.js
@@ -58,25 +58,6 @@ exports.DocumentEntry = Montage.create(Component, {
58 } 58 }
59 }, 59 },
60 60
61 _active: {
62 enumerable: false,
63 value: null
64 },
65
66 active: {
67 get: function() {
68 return this._active;
69 },
70 set: function(value) {
71 var previousValue = this._active;
72 this._active = value;
73
74 if (previousValue !== this._active) {
75 this.needsDraw = true;
76 }
77 }
78 },
79
80 _saveFlag: { 61 _saveFlag: {
81 value: false 62 value: false
82 }, 63 },
@@ -96,7 +77,8 @@ exports.DocumentEntry = Montage.create(Component, {
96 prepareForDraw: { 77 prepareForDraw: {
97 enumerable: false, 78 enumerable: false,
98 value: function() { 79 value: function() {
99 this.element.addEventListener("click", this, false); 80// this.element.addEventListener("click", this, false);
81// this.closeBtn.addEventListener("click", this, true);
100 } 82 }
101 }, 83 },
102 84
@@ -106,7 +88,7 @@ exports.DocumentEntry = Montage.create(Component, {
106 value: function() { 88 value: function() {
107 this.label.innerText = this._name ? this._name : ""; 89 this.label.innerText = this._name ? this._name : "";
108 90
109 this._active ? this.element.classList.add("activeTab") : this.element.classList.remove("activeTab"); 91// this._active ? this.element.classList.add("activeTab") : this.element.classList.remove("activeTab");
110 92
111 if(this.saveFlag) { 93 if(this.saveFlag) {
112 this.label.classList.add("dirty"); 94 this.label.classList.add("dirty");
@@ -116,15 +98,19 @@ exports.DocumentEntry = Montage.create(Component, {
116 } 98 }
117 }, 99 },
118 100
119 handleClick: { 101 captureClick: {
120 value: function(event) { 102 value: function(event) {
121 if(event._event.target.nodeName === "IMG") { 103 console.log("clicked on the X");
122 this.application.ninja.documentController.closeFile(this.application.ninja.documentController._findDocumentByUUID(this._uuid)); 104 event.preventDefault();
123 } else { 105 event.stopImmediatePropagation();
124 if(!this.active) { 106 event.stopPropagation();
125 this.application.ninja.documentController.switchDocuments(this.application.ninja.currentDocument, this.application.ninja.documentController._findDocumentByUUID(this._uuid)); 107// if(event._event.target.nodeName === "IMG") {
126 } 108// this.application.ninja.documentController.closeFile(this.application.ninja.documentController._findDocumentByUUID(this._uuid));
127 } 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// }
128 } 114 }
129 } 115 }
130 116