diff options
Diffstat (limited to 'js/components/editable.reel')
-rw-r--r-- | js/components/editable.reel/editable.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/js/components/editable.reel/editable.js b/js/components/editable.reel/editable.js index 9c8946c4..ca65bc2a 100644 --- a/js/components/editable.reel/editable.js +++ b/js/components/editable.reel/editable.js | |||
@@ -115,12 +115,15 @@ exports.Editable = Montage.create(Component, { | |||
115 | ///// Save the preEditValue | 115 | ///// Save the preEditValue |
116 | this._preEditValue = this.value; | 116 | this._preEditValue = this.value; |
117 | 117 | ||
118 | // Initialize enteredValue with current value | ||
119 | this.enteredValue = this.value; | ||
120 | |||
118 | if(this.selectOnStart) { | 121 | if(this.selectOnStart) { |
119 | this.selectAll(); | 122 | this.selectAll(); |
120 | } | 123 | } |
121 | 124 | ||
122 | if(this.stopOnBlur) { | 125 | if(this.stopOnBlur) { |
123 | console.log('adding mousedown event listener'); | 126 | //console.log('adding mousedown event listener'); |
124 | ///// Simulate blur on editable node by listening to the doc | 127 | ///// Simulate blur on editable node by listening to the doc |
125 | document.addEventListener('mouseup', this, false); | 128 | document.addEventListener('mouseup', this, false); |
126 | } | 129 | } |
@@ -189,7 +192,11 @@ exports.Editable = Montage.create(Component, { | |||
189 | handleKeydown : { | 192 | handleKeydown : { |
190 | value : function(e) { | 193 | value : function(e) { |
191 | var k = e.keyCode; | 194 | var k = e.keyCode; |
192 | console.log('keyCode: ' + k); | 195 | |
196 | // Record change | ||
197 | this.enteredValue = this._element.firstChild.data; | ||
198 | |||
199 | //console.log('keyCode: ' + k); | ||
193 | } | 200 | } |
194 | }, | 201 | }, |
195 | ///// Text input has changed values | 202 | ///// Text input has changed values |
@@ -204,7 +211,7 @@ exports.Editable = Montage.create(Component, { | |||
204 | }, | 211 | }, |
205 | handleMouseup : { | 212 | handleMouseup : { |
206 | value : function(e) { | 213 | value : function(e) { |
207 | console.log('handle mouse down'); | 214 | //console.log('handle mouse down'); |
208 | ///// Listen for simulated blur event | 215 | ///// Listen for simulated blur event |
209 | if(this.stopOnBlur && e._event.target !== this._element) { | 216 | if(this.stopOnBlur && e._event.target !== this._element) { |
210 | this.blur(); | 217 | this.blur(); |
@@ -213,7 +220,7 @@ exports.Editable = Montage.create(Component, { | |||
213 | }, | 220 | }, |
214 | handleEvent : { | 221 | handleEvent : { |
215 | value : function(e) { | 222 | value : function(e) { |
216 | console.log("event type : " + e._event.type); | 223 | //console.log("event type : " + e._event.type); |
217 | ///// If configured, start on specified event | 224 | ///// If configured, start on specified event |
218 | if(e._event.type === this.startOnEvent) { | 225 | if(e._event.type === this.startOnEvent) { |
219 | this.start(); | 226 | this.start(); |