fix pasting in readOnly mode
This commit is contained in:
parent
abcf0d4771
commit
a9caa11447
2 changed files with 7 additions and 0 deletions
|
|
@ -694,6 +694,9 @@ var Editor = function(renderer, session) {
|
||||||
* called whenever a text "paste" happens.
|
* called whenever a text "paste" happens.
|
||||||
**/
|
**/
|
||||||
this.onPaste = function(text) {
|
this.onPaste = function(text) {
|
||||||
|
// todo this should change when paste becomes a command
|
||||||
|
if (this.$readOnly)
|
||||||
|
return;
|
||||||
this._emit("paste", text);
|
this._emit("paste", text);
|
||||||
this.insert(text);
|
this.insert(text);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -502,7 +502,11 @@ var Editor = require("./editor").Editor;
|
||||||
return text;
|
return text;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// todo this should change when paste becomes a command
|
||||||
this.onPaste = function(text) {
|
this.onPaste = function(text) {
|
||||||
|
if (this.$readOnly)
|
||||||
|
return;
|
||||||
|
|
||||||
this._emit("paste", text);
|
this._emit("paste", text);
|
||||||
if (!this.inMultiSelectMode)
|
if (!this.inMultiSelectMode)
|
||||||
return this.insert(text);
|
return this.insert(text);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue