diff --git a/dist/entry.js b/dist/entry.js index 1e3b523a7a..ea5ae0772f 100644 --- a/dist/entry.js +++ b/dist/entry.js @@ -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) { diff --git a/dist/entry.min.js b/dist/entry.min.js index 75d59a8625..2ffef957f0 100644 --- a/dist/entry.min.js +++ b/dist/entry.min.js @@ -798,10 +798,10 @@ Entry.SVG.attr=function(b,a){if("string"===typeof b){var d={};d[b]=a;b=d}if(b){b Entry.SVG.removeClass=function(b){for(var a=this.getAttribute("class"),d=0;db.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));Entry.requestUpdate= -!0}; -Entry.Dialog.prototype.createSpeakNotch=function(b){var a=new createjs.Shape;a.type=b;"ne"==b?a.graphics.f("#f5f5f5").ss(2,"round").s("#6FC0DD").mt(0,this.height+this.padding-1.5).lt(-10,this.height+this.padding+20).lt(20,this.height+this.padding-1.5):"nw"==b?a.graphics.f("#f5f5f5").ss(2,"round").s("#6FC0DD").mt(this.width,this.height+this.padding-1.5).lt(this.width+10,this.height+this.padding+20).lt(this.width-20,this.height+this.padding-1.5):"se"==b?a.graphics.f("#f5f5f5").ss(2,"round").s("#6FC0DD").mt(0,-this.padding+ -1.5).lt(-10,-this.padding-20).lt(20,-this.padding+1.5):"sw"==b&&a.graphics.f("#f5f5f5").ss(2,"round").s("#6FC0DD").mt(this.width,-this.padding+1.5).lt(this.width+10,-this.padding-20).lt(this.width-20,-this.padding+1.5);return a};Entry.Dialog.prototype.remove=function(){Entry.stage.unloadDialog(this);this.parent.dialog=null;Entry.requestUpdate=!0};Entry.DoneProject=function(b){this.generateView(b)};var p=Entry.DoneProject.prototype;p.init=function(b){this.projectId=b};p.generateView=function(b){var a=Entry.createElement("div");a.addClass("entryContainerDoneWorkspace");this.doneContainer=a;var d=Entry.createElement("iframe");d.setAttribute("id","doneProjectframe");d.setAttribute("frameborder",0);d.setAttribute("src","/api/iframe/project/"+b);this.doneProjectFrame=d;this.doneContainer.appendChild(d);a.addClass("entryRemove")};p.getView=function(){return this.doneContainer}; +Entry.Dialog.prototype.update=function(){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="";-135b.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){var a=new createjs.Shape;a.type=b;"ne"==b?a.graphics.f("#f5f5f5").ss(2,"round").s("#6FC0DD").mt(0,this.height+this.padding-1.5).lt(-10,this.height+this.padding+20).lt(20,this.height+this.padding-1.5):"nw"==b?a.graphics.f("#f5f5f5").ss(2,"round").s("#6FC0DD").mt(this.width,this.height+this.padding-1.5).lt(this.width+10,this.height+this.padding+20).lt(this.width-20,this.height+this.padding-1.5):"se"==b?a.graphics.f("#f5f5f5").ss(2,"round").s("#6FC0DD").mt(0, +-this.padding+1.5).lt(-10,-this.padding-20).lt(20,-this.padding+1.5):"sw"==b&&a.graphics.f("#f5f5f5").ss(2,"round").s("#6FC0DD").mt(this.width,-this.padding+1.5).lt(this.width+10,-this.padding-20).lt(this.width-20,-this.padding+1.5);return a};Entry.Dialog.prototype.remove=function(){Entry.stage.unloadDialog(this);this.parent.dialog=null;Entry.requestUpdate=!0};Entry.DoneProject=function(b){this.generateView(b)};var p=Entry.DoneProject.prototype;p.init=function(b){this.projectId=b};p.generateView=function(b){var a=Entry.createElement("div");a.addClass("entryContainerDoneWorkspace");this.doneContainer=a;var d=Entry.createElement("iframe");d.setAttribute("id","doneProjectframe");d.setAttribute("frameborder",0);d.setAttribute("src","/api/iframe/project/"+b);this.doneProjectFrame=d;this.doneContainer.appendChild(d);a.addClass("entryRemove")};p.getView=function(){return this.doneContainer}; p.resize=function(){document.getElementById("entryContainerWorkspaceId");var b=document.getElementById("doneProjectframe"),a=this.doneContainer.offsetWidth;b.width=a+"px";b.height=9*a/16+"px"};Entry.Engine=function(){function b(a){var b=[37,38,39,40,32],c=a.keyCode||a.which,e=Entry.stage.inputField;32==c&&e&&e.hasFocus()||-1 -135) { @@ -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; };