Skip to content

Commit

Permalink
add issue 4637
Browse files Browse the repository at this point in the history
  • Loading branch information
chanlee committed Sep 26, 2016
2 parents 822b66d + c3317b2 commit feeee5d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
13 changes: 12 additions & 1 deletion dist/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -7475,10 +7475,21 @@ Entry.Dialog.prototype.generateSpeak = function() {
Entry.requestUpdate = !0;
};
Entry.Dialog.prototype.update = function() {
var b = this.parent.object.getTransformedBounds(), a = "";
var b = this.parent.object.getTransformedBounds();
if (!b && "textBox" === this.parent.type) {
if (this._isNoContentTried) {
delete this._isNoContentTried;
return;
}
this.parent.setText(" ");
b = this.parent.object.getTransformedBounds();
this._isNoContentTried = !0;
}
var a = "";
-135 < b.y - this.height - 20 - this.border ? (this.object.y = b.y - this.height / 2 - 20 - this.padding, a += "n") : (this.object.y = b.y + b.height + this.height / 2 + 20 + this.padding, a += "s");
240 > b.x + b.width + this.width ? (this.object.x = b.x + b.width + this.width / 2, a += "e") : (this.object.x = b.x - this.width / 2, a += "w");
this.notch.type != a && (this.object.removeChild(this.notch), this.notch = this.createSpeakNotch(a), this.object.addChild(this.notch));
this._isNoContentTried && this.parent.setText("");
Entry.requestUpdate = !0;
};
Entry.Dialog.prototype.createSpeakNotch = function(b) {
Expand Down
8 changes: 4 additions & 4 deletions dist/entry.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions src/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ Entry.Dialog.prototype.generateSpeak = function() {
*/
Entry.Dialog.prototype.update = function() {
var bound = this.parent.object.getTransformedBounds();
if (!bound && this.parent.type === 'textBox') {
if (!this._isNoContentTried) {
this.parent.setText(' ');
bound = this.parent.object.getTransformedBounds();
this._isNoContentTried = true;
} else {
delete this._isNoContentTried;
return;
}
}
var notchType = '';

if (bound.y - this.height -20 - this.border> -135) {
Expand All @@ -88,6 +98,8 @@ Entry.Dialog.prototype.update = function() {
this.notch = this.createSpeakNotch(notchType);
this.object.addChild(this.notch);
}

this._isNoContentTried && this.parent.setText('');
Entry.requestUpdate = true;
};

Expand Down

0 comments on commit feeee5d

Please sign in to comment.