aboutsummaryrefslogtreecommitdiff
path: root/js/components/layout/document-entry.reel
diff options
context:
space:
mode:
authorArmen Kesablyan2012-02-22 16:26:41 -0800
committerArmen Kesablyan2012-02-22 16:26:41 -0800
commit0bd1cefea2ab350fad1a891bdc926053b799aafc (patch)
tree962f559fcc02a3dfeb297d59907e40fa153453f3 /js/components/layout/document-entry.reel
parent695bc5082f48dddf66ce31480a4faefc067b38bd (diff)
parent2d2b1af8b5c0d506fe6a1cf65614101fec145970 (diff)
downloadninja-0bd1cefea2ab350fad1a891bdc926053b799aafc.tar.gz
Merge branch 'refs/heads/master' into new-tool-icons
Diffstat (limited to 'js/components/layout/document-entry.reel')
-rwxr-xr-x[-rw-r--r--]js/components/layout/document-entry.reel/close_button.gifbin139 -> 139 bytes
-rwxr-xr-x[-rw-r--r--]js/components/layout/document-entry.reel/document-entry.css1
-rwxr-xr-x[-rw-r--r--]js/components/layout/document-entry.reel/document-entry.html1
-rwxr-xr-x[-rw-r--r--]js/components/layout/document-entry.reel/document-entry.js27
4 files changed, 25 insertions, 4 deletions
diff --git a/js/components/layout/document-entry.reel/close_button.gif b/js/components/layout/document-entry.reel/close_button.gif
index 00b5904b..00b5904b 100644..100755
--- a/js/components/layout/document-entry.reel/close_button.gif
+++ b/js/components/layout/document-entry.reel/close_button.gif
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 ce173cd6..52d08d72 100644..100755
--- a/js/components/layout/document-entry.reel/document-entry.css
+++ b/js/components/layout/document-entry.reel/document-entry.css
@@ -35,4 +35,5 @@
35 35
36.documentEntry span.dirty:before{ 36.documentEntry span.dirty:before{
37 content: "*"; 37 content: "*";
38 display:inline;
38} 39}
diff --git a/js/components/layout/document-entry.reel/document-entry.html b/js/components/layout/document-entry.reel/document-entry.html
index ba17449a..1cf01737 100644..100755
--- a/js/components/layout/document-entry.reel/document-entry.html
+++ b/js/components/layout/document-entry.reel/document-entry.html
@@ -26,7 +26,6 @@
26 <body> 26 <body>
27 <li id="documentEntry" class="documentEntry"> 27 <li id="documentEntry" class="documentEntry">
28 <div id="isActive"></div> 28 <div id="isActive"></div>
29 <div id="dirtyFlag"></div>
30 <span id="name"></span> 29 <span id="name"></span>
31 <img src="js/components/layout/document-entry.reel/close_button.gif"> 30 <img src="js/components/layout/document-entry.reel/close_button.gif">
32 </li> 31 </li>
diff --git a/js/components/layout/document-entry.reel/document-entry.js b/js/components/layout/document-entry.reel/document-entry.js
index 6f265c91..9e4110e2 100644..100755
--- a/js/components/layout/document-entry.reel/document-entry.js
+++ b/js/components/layout/document-entry.reel/document-entry.js
@@ -77,11 +77,26 @@ exports.DocumentEntry = Montage.create(Component, {
77 } 77 }
78 }, 78 },
79 79
80 _saveFlag: {
81 value: false
82 },
83
84 saveFlag: {
85 get: function() {
86 return this._saveFlag;
87 },
88 set: function(value) {
89 if(this._saveFlag !== value) {
90 this._saveFlag = value;
91 this.needsDraw = true;
92 }
93 }
94 },
80 95
81 prepareForDraw: { 96 prepareForDraw: {
82 enumerable: false, 97 enumerable: false,
83 value: function() { 98 value: function() {
84 //this.element.addEventListener("click", this, false); 99 this.element.addEventListener("click", this, false);
85 } 100 }
86 }, 101 },
87 102
@@ -92,16 +107,22 @@ exports.DocumentEntry = Montage.create(Component, {
92 this.label.innerText = this._name ? this._name : ""; 107 this.label.innerText = this._name ? this._name : "";
93 108
94 this._active ? this.element.classList.add("activeTab") : this.element.classList.remove("activeTab"); 109 this._active ? this.element.classList.add("activeTab") : this.element.classList.remove("activeTab");
110
111 if(this.saveFlag) {
112 this.label.classList.add("dirty");
113 } else {
114 this.label.classList.remove("dirty");
115 }
95 } 116 }
96 }, 117 },
97 118
98 handleClick: { 119 handleClick: {
99 value: function(event) { 120 value: function(event) {
100 if(event._event.target.nodeName === "IMG") { 121 if(event._event.target.nodeName === "IMG") {
101 documentManagerModule.DocumentManager.closeDocument(this._uuid); 122 this.application.ninja.documentController.closeDocument(this._uuid);
102 } else { 123 } else {
103 if(!this._document.isActive) { 124 if(!this._document.isActive) {
104 documentManagerModule.DocumentManager.switchDocument(this._uuid); 125 this.application.ninja.stage.stageView.switchDocument(this.application.ninja.documentController._findDocumentByUUID(this._uuid));
105 } 126 }
106 } 127 }
107 } 128 }