File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed
Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -312,7 +312,6 @@ export default Vue.extend({
312312 if ( this . $refs . content !== void 0 && this . __offsetBottom !== void 0 ) {
313313 this . $refs . content . scrollTop = this . $refs . content . scrollHeight - this . __offsetBottom
314314 }
315- this . caret . restore ( )
316315 } )
317316 } ,
318317
Original file line number Diff line number Diff line change @@ -227,9 +227,7 @@ export class Caret {
227227 return
228228 }
229229 else if ( cmd === 'link' ) {
230- const
231- link = this . getParentAttribute ( 'href' ) ,
232- range = this . range
230+ const link = this . getParentAttribute ( 'href' )
233231
234232 if ( link === null ) {
235233 const selection = this . selectWord ( this . selection )
@@ -241,15 +239,15 @@ export class Caret {
241239
242240 this . vm . editLinkUrl = urlRegex . test ( url ) ? url : 'https://'
243241 document . execCommand ( 'createLink' , false , this . vm . editLinkUrl )
242+
243+ this . save ( selection . getRangeAt ( 0 ) )
244244 }
245245 else {
246246 this . vm . editLinkUrl = link
247- }
248247
249- this . vm . $nextTick ( ( ) => {
250- range . selectNodeContents ( this . parent )
251- this . save ( range )
252- } )
248+ this . range . selectNodeContents ( this . parent )
249+ this . save ( )
250+ }
253251
254252 return
255253 }
You can’t perform that action at this time.
0 commit comments