zhangchao 4 년 전
부모
커밋
59487f1a70
1개의 변경된 파일13개의 추가작업 그리고 11개의 파일을 삭제
  1. 13
    11
      src/RichTextEditor.js

+ 13
- 11
src/RichTextEditor.js 파일 보기

@@ -247,7 +247,7 @@ export default class RichTextEditor extends Component {
247 247
   }
248 248
 
249 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 251
     const containerPlatformStyle = {justifyContent: 'space-between'};
252 252
     const buttonPlatformStyle = {flex: 1, height: 45, justifyContent: 'center'};
253 253
     const { linkOption } = this.props;
@@ -440,19 +440,21 @@ export default class RichTextEditor extends Component {
440 440
   }
441 441
 
442 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 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 460
   insertImage(url) {