diff options
author | Ananya Sen | 2012-02-05 19:20:37 -0800 |
---|---|---|
committer | Ananya Sen | 2012-02-05 19:20:37 -0800 |
commit | 272c5f74f4ce76fec9cbe360817bf23639307d3a (patch) | |
tree | 1ae8ff6bbf6f22fbcca1e1a70f3063855d00ee46 /js/components/layout | |
parent | 45cfffd9261ab1aa714554c584f0d0d8fe627c91 (diff) | |
download | ninja-272c5f74f4ce76fec9cbe360817bf23639307d3a.tar.gz |
changes to show document dirty indicator on editing code view, and to remove dirty indicator on save.
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/components/layout')
3 files changed, 29 insertions, 0 deletions
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 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.js b/js/components/layout/document-entry.reel/document-entry.js index 2a33548a..a1bed79b 100755 --- a/js/components/layout/document-entry.reel/document-entry.js +++ b/js/components/layout/document-entry.reel/document-entry.js | |||
@@ -77,6 +77,23 @@ exports.DocumentEntry = Montage.create(Component, { | |||
77 | } | 77 | } |
78 | }, | 78 | }, |
79 | 79 | ||
80 | _dirtyFlag:{ | ||
81 | enumerable:false, | ||
82 | value:false | ||
83 | }, | ||
84 | dirtyFlag:{ | ||
85 | get: function() { | ||
86 | return this._dirtyFlag; | ||
87 | }, | ||
88 | set: function(value) { | ||
89 | var previousValue = this._dirtyFlag; | ||
90 | this._dirtyFlag = value; | ||
91 | |||
92 | if (previousValue !== this._dirtyFlag) { | ||
93 | this.needsDraw = true; | ||
94 | } | ||
95 | } | ||
96 | }, | ||
80 | 97 | ||
81 | prepareForDraw: { | 98 | prepareForDraw: { |
82 | enumerable: false, | 99 | enumerable: false, |
@@ -92,6 +109,12 @@ exports.DocumentEntry = Montage.create(Component, { | |||
92 | this.label.innerText = this._name ? this._name : ""; | 109 | this.label.innerText = this._name ? this._name : ""; |
93 | 110 | ||
94 | this._active ? this.element.classList.add("activeTab") : this.element.classList.remove("activeTab"); | 111 | this._active ? this.element.classList.add("activeTab") : this.element.classList.remove("activeTab"); |
112 | |||
113 | if(this.dirtyFlag === true){ | ||
114 | if(!this.label.classList.contains("dirty")){this.label.classList.add("dirty");} | ||
115 | }else{ | ||
116 | if(this.label.classList.contains("dirty")){this.label.classList.remove("dirty");} | ||
117 | } | ||
95 | } | 118 | } |
96 | }, | 119 | }, |
97 | 120 | ||
diff --git a/js/components/layout/documents-tab.reel/documents-tab.html b/js/components/layout/documents-tab.reel/documents-tab.html index 94b2e46e..82ba8782 100755 --- a/js/components/layout/documents-tab.reel/documents-tab.html +++ b/js/components/layout/documents-tab.reel/documents-tab.html | |||
@@ -38,6 +38,11 @@ | |||
38 | "boundObjectPropertyPath": "objectAtCurrentIteration.name", | 38 | "boundObjectPropertyPath": "objectAtCurrentIteration.name", |
39 | "oneway": true | 39 | "oneway": true |
40 | }, | 40 | }, |
41 | "dirtyFlag": { | ||
42 | "boundObject": {"@": "repetition1"}, | ||
43 | "boundObjectPropertyPath": "objectAtCurrentIteration.dirtyFlag", | ||
44 | "oneway": true | ||
45 | }, | ||
41 | "active": { | 46 | "active": { |
42 | "boundObject": {"@": "repetition1"}, | 47 | "boundObject": {"@": "repetition1"}, |
43 | "boundObjectPropertyPath": "objectAtCurrentIteration.isActive", | 48 | "boundObjectPropertyPath": "objectAtCurrentIteration.isActive", |