zhangchao 5 vuotta sitten
vanhempi
commit
59487f1a70
1 muutettua tiedostoa jossa 13 lisäystä ja 11 poistoa
  1. 13
    11
      src/RichTextEditor.js

+ 13
- 11
src/RichTextEditor.js Näytä tiedosto

247
   }
247
   }
248
 
248
 
249
   _renderModalButtons() {
249
   _renderModalButtons() {
250
-    const insertUpdateDisabled = this.state.linkTitle.trim().length <= 0 || this.state.linkUrl.trim().length <= 0;
250
+    const insertUpdateDisabled = this.state.linkUrl.trim().length <= 0;
251
     const containerPlatformStyle = {justifyContent: 'space-between'};
251
     const containerPlatformStyle = {justifyContent: 'space-between'};
252
     const buttonPlatformStyle = {flex: 1, height: 45, justifyContent: 'center'};
252
     const buttonPlatformStyle = {flex: 1, height: 45, justifyContent: 'center'};
253
     const { linkOption } = this.props;
253
     const { linkOption } = this.props;
440
   }
440
   }
441
 
441
 
442
   insertLink(url, title) {
442
   insertLink(url, title) {
443
-    if (/^(http:\/\/|https:\/\/)/.test(url)) {
444
-      this._sendAction(actions.insertLink, {url, title});
445
-    } else {
446
-      this.notCheckedUrlCallback && this.notCheckedUrlCallback()
447
-    }
443
+    this._sendAction(actions.insertLink, {url, title: title || url});
444
+    // if (/^(http:\/\/|https:\/\/)/.test(url)) {
445
+    //   this._sendAction(actions.insertLink, {url, title: title || url});
446
+    // } else {
447
+    //   this.notCheckedUrlCallback && this.notCheckedUrlCallback()
448
+    // }
448
   }
449
   }
449
 
450
 
450
   updateLink(url, title) {
451
   updateLink(url, title) {
451
-    if (/^(http:\/\/|https:\/\/)/.test(url)) {
452
-      this._sendAction(actions.updateLink, {url, title});
453
-    } else {
454
-      this.notCheckedUrlCallback && this.notCheckedUrlCallback()
455
-    }
452
+    this._sendAction(actions.updateLink, {url, title: title || url});
453
+    // if (/^(http:\/\/|https:\/\/)/.test(url)) {
454
+    //   this._sendAction(actions.updateLink, {url, title: title || url});
455
+    // } else {
456
+    //   this.notCheckedUrlCallback && this.notCheckedUrlCallback()
457
+    // }
456
   }
458
   }
457
 
459
 
458
   insertImage(url) {
460
   insertImage(url) {