diff options
| author | Jens Mönig <jens@moenig.org> | 2015-05-01 11:50:59 -0400 |
|---|---|---|
| committer | Jens Mönig <jens@moenig.org> | 2015-05-01 11:50:59 -0400 |
| commit | 340f91b7f2c46e0068562935c7277054d779e1bf (patch) | |
| tree | 84e2df0a4991e053ce5be5e3a48d3971bb5f35e4 | |
| parent | 9e4b73eae9adcbad1cef270411b56d0676cf0006 (diff) | |
| download | snap-340f91b7f2c46e0068562935c7277054d779e1bf.tar.gz snap-340f91b7f2c46e0068562935c7277054d779e1bf.zip | |
Morphic: event hook for first mouse click on editable text
| -rw-r--r-- | morphic.js | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1048,7 +1048,7 @@ /*global window, HTMLCanvasElement, getMinimumFontHeight, FileReader, Audio, FileList, getBlurredShadowSupport*/ -var morphicVersion = '2015-March-24'; +var morphicVersion = '2015-May-01'; var modules = {}; // keep track of additional loaded modules var useBlurredShadows = getBlurredShadowSupport(); // check for Chrome-bug @@ -7454,6 +7454,8 @@ StringMorph.prototype.mouseClickLeft = function (pos) { StringMorph.prototype.enableSelecting = function () { this.mouseDownLeft = function (pos) { + var crs = this.root().cursor, + already = crs ? crs.target === this : false; this.clearSelection(); if (this.isEditable && (!this.isDraggable)) { this.edit(); @@ -7461,6 +7463,7 @@ StringMorph.prototype.enableSelecting = function () { this.startMark = this.slotAt(pos); this.endMark = this.startMark; this.currentlySelecting = true; + if (!already) {this.escalateEvent('mouseDownLeft', pos); } } }; this.mouseMove = function (pos) { |
