Bläddra i källkod

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

master
Leonard Kim 7 år sedan
förälder
incheckning
c377219013

+ 5
- 0
css/modals/invite/_info.scss Visa fil

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

+ 21
- 1
react/features/invite/components/info-dialog/InfoDialog.web.js Visa fil

147
         this._copyElement = null;
147
         this._copyElement = null;
148
 
148
 
149
         // Bind event handlers so they are only bound once for every instance.
149
         // Bind event handlers so they are only bound once for every instance.
150
+        this._onClickInviteURL = this._onClickInviteURL.bind(this);
150
         this._onCopyInviteURL = this._onCopyInviteURL.bind(this);
151
         this._onCopyInviteURL = this._onCopyInviteURL.bind(this);
151
         this._onPasswordRemove = this._onPasswordRemove.bind(this);
152
         this._onPasswordRemove = this._onPasswordRemove.bind(this);
152
         this._onPasswordSubmit = this._onPasswordSubmit.bind(this);
153
         this._onPasswordSubmit = this._onPasswordSubmit.bind(this);
219
                         </span>
220
                         </span>
220
                         <span className = 'spacer'>&nbsp;</span>
221
                         <span className = 'spacer'>&nbsp;</span>
221
                         <span className = 'info-value'>
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
                         </span>
229
                         </span>
224
                     </div>
230
                     </div>
225
                     <div className = 'info-dialog-dial-in'>
231
                     <div className = 'info-dialog-dial-in'>
346
         return this.props._inviteURL.replace(/^https?:\/\//i, '');
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
      * Callback invoked to copy the contents of {@code this._copyElement} to the
370
      * Callback invoked to copy the contents of {@code this._copyElement} to the
351
      * clipboard.
371
      * clipboard.

Laddar…
Avbryt
Spara