浏览代码

feat(info): invite url as an anchor for copying from context menu

master
Leonard Kim 7 年前
父节点
当前提交
c377219013
共有 2 个文件被更改,包括 26 次插入1 次删除
  1. 5
    0
      css/modals/invite/_info.scss
  2. 21
    1
      react/features/invite/components/info-dialog/InfoDialog.web.js

+ 5
- 0
css/modals/invite/_info.scss 查看文件

@@ -81,6 +81,11 @@
81 81
         font-size: 16px;
82 82
     }
83 83
 
84
+    .info-dialog-invite-link {
85
+        color: inherit;
86
+        cursor: inherit;
87
+    }
88
+
84 89
     .info-dialog-title {
85 90
         font-weight: bold;
86 91
         margin-bottom: 10px;

+ 21
- 1
react/features/invite/components/info-dialog/InfoDialog.web.js 查看文件

@@ -147,6 +147,7 @@ class InfoDialog extends Component {
147 147
         this._copyElement = null;
148 148
 
149 149
         // Bind event handlers so they are only bound once for every instance.
150
+        this._onClickInviteURL = this._onClickInviteURL.bind(this);
150 151
         this._onCopyInviteURL = this._onCopyInviteURL.bind(this);
151 152
         this._onPasswordRemove = this._onPasswordRemove.bind(this);
152 153
         this._onPasswordSubmit = this._onPasswordSubmit.bind(this);
@@ -219,7 +220,12 @@ class InfoDialog extends Component {
219 220
                         </span>
220 221
                         <span className = 'spacer'>&nbsp;</span>
221 222
                         <span className = 'info-value'>
222
-                            { this._getURLToDisplay() }
223
+                            <a
224
+                                className = 'info-dialog-invite-link'
225
+                                href = { this.props._inviteURL }
226
+                                onClick = { this._onClickInviteURL } >
227
+                                { this._getURLToDisplay() }
228
+                            </a>
223 229
                         </span>
224 230
                     </div>
225 231
                     <div className = 'info-dialog-dial-in'>
@@ -346,6 +352,20 @@ class InfoDialog extends Component {
346 352
         return this.props._inviteURL.replace(/^https?:\/\//i, '');
347 353
     }
348 354
 
355
+    /**
356
+     * Callback invoked when the displayed invite URL link is clicked to prevent
357
+     * actual navigation from happening. The invite URL link has an href to
358
+     * display "Copy Link Address" in the context menu but otherwise it should
359
+     * not behave like a link.
360
+     *
361
+     * @param {Object} event - The click event from clicking on the link.
362
+     * @private
363
+     * @returns {void}
364
+     */
365
+    _onClickInviteURL(event) {
366
+        event.preventDefault();
367
+    }
368
+
349 369
     /**
350 370
      * Callback invoked to copy the contents of {@code this._copyElement} to the
351 371
      * clipboard.

正在加载...
取消
保存