This commit is contained in:
@@ -165,7 +165,7 @@ export default {
|
||||
return (
|
||||
source.slice(0, start) +
|
||||
newSubStr +
|
||||
this.slice(start + Math.abs(delCount))
|
||||
source.slice(start + Math.abs(delCount))
|
||||
);
|
||||
},
|
||||
|
||||
|
||||
@@ -66,6 +66,7 @@
|
||||
<v-textarea
|
||||
ref="editArea"
|
||||
@input="handleInput"
|
||||
@dblclick="handleDoubleClick"
|
||||
v-model="localVal"
|
||||
auto-grow
|
||||
></v-textarea>
|
||||
@@ -119,7 +120,7 @@ export default {
|
||||
this.selection.end
|
||||
);
|
||||
}
|
||||
return selectedText;
|
||||
return selectedText; //.trim();
|
||||
},
|
||||
replaceSelectedText(newString) {
|
||||
// @param {String} source string
|
||||
@@ -128,10 +129,10 @@ export default {
|
||||
// @param {string} newSubStr The String that is spliced in.
|
||||
// @return {string} A new string with the spliced substring.
|
||||
//stringSplice: function(source, start, delCount, newSubStr) {
|
||||
|
||||
//says replace but in some cases it's just an insert if there is no selection:
|
||||
|
||||
//has a selection so replace it is:
|
||||
//says replace but in some cases it's just an insert if there is no selection:
|
||||
|
||||
//has a selection so replace it is:
|
||||
|
||||
this.localVal = window.$gz.util.stringSplice(
|
||||
this.localVal,
|
||||
@@ -142,14 +143,27 @@ export default {
|
||||
},
|
||||
clickBold() {
|
||||
this.updateSelectedRange();
|
||||
|
||||
console.log("BOLD CLICK, selection:", this.getSelectedText());
|
||||
this.replaceSelectedText("**" + this.getSelectedText() + "**");
|
||||
//console.log("BOLD CLICK, selection:", this.getSelectedText());
|
||||
},
|
||||
|
||||
handleDoubleClick(i) {
|
||||
//the purpose of this is only to change the selection if it's got an extra space to the right
|
||||
//becuase double clicking on a word with another word after it causes the space to be included
|
||||
this.updateSelectedRange();
|
||||
let temp = this.getSelectedText();
|
||||
let tempTrimmed = temp.trimEnd();
|
||||
let diff = temp.length - tempTrimmed.length;
|
||||
if (diff != 0) {
|
||||
//there were some spaces so update the selection range
|
||||
//force selection to be shorter by diff
|
||||
}
|
||||
},
|
||||
handleInput(val) {
|
||||
this.$emit("input", val);
|
||||
this.localVal = val;
|
||||
},
|
||||
|
||||
switchViewIcon() {
|
||||
//return the icon that indicates what it will change to if you click it
|
||||
//mirror of switchview below
|
||||
|
||||
Reference in New Issue
Block a user