kopia lustrzana https://github.com/backface/turtlestitch
Remove extra hiddenText assignment in clipboards
rodzic
abe5f3fe1d
commit
1f9e923d04
11
morphic.js
11
morphic.js
|
@ -4496,19 +4496,18 @@ CursorMorph.prototype.init = function (aStringOrTextMorph) {
|
||||||
this.target.setAlignmentToLeft();
|
this.target.setAlignmentToLeft();
|
||||||
}
|
}
|
||||||
this.gotoSlot(this.slot);
|
this.gotoSlot(this.slot);
|
||||||
|
|
||||||
// Add hidden text box for copying and pasting
|
// Add hidden text box for copying and pasting
|
||||||
this.hiddenText = document.createElement('textarea');
|
this.hiddenText = document.createElement('textarea');
|
||||||
this.target.hiddenText = this.hiddenText;
|
|
||||||
this.hiddenText.style.position = 'absolute';
|
this.hiddenText.style.position = 'absolute';
|
||||||
this.hiddenText.style.right = '101%'; // placed just out of view
|
this.hiddenText.style.right = '101%'; // placed just out of view
|
||||||
|
|
||||||
document.body.appendChild(this.hiddenText);
|
document.body.appendChild(this.hiddenText);
|
||||||
|
|
||||||
this.hiddenText.value = this.target.selection();
|
this.hiddenText.value = this.target.selection();
|
||||||
this.hiddenText.focus();
|
this.hiddenText.focus();
|
||||||
this.hiddenText.select();
|
this.hiddenText.select();
|
||||||
|
|
||||||
this.hiddenText.addEventListener(
|
this.hiddenText.addEventListener(
|
||||||
'keypress',
|
'keypress',
|
||||||
function (event) {
|
function (event) {
|
||||||
|
@ -4518,7 +4517,7 @@ CursorMorph.prototype.init = function (aStringOrTextMorph) {
|
||||||
},
|
},
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
this.hiddenText.addEventListener(
|
this.hiddenText.addEventListener(
|
||||||
'keydown',
|
'keydown',
|
||||||
function (event) {
|
function (event) {
|
||||||
|
|
Ładowanie…
Reference in New Issue