diff options
Diffstat (limited to 'js/components/layout/document-entry.reel/document-entry.js')
-rwxr-xr-x[-rw-r--r--] | js/components/layout/document-entry.reel/document-entry.js | 27 |
1 files changed, 24 insertions, 3 deletions
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 | } |