yanas пре 8 година
родитељ
комит
b54f92b2ae
2 измењених фајлова са 17 додато и 7 уклоњено
  1. 16
    6
      modules/UI/toolbars/Toolbar.js
  2. 1
    1
      modules/UI/util/MessageHandler.js

+ 16
- 6
modules/UI/toolbars/Toolbar.js Прегледај датотеку

@@ -20,15 +20,24 @@ function openLinkDialog () {
20 20
         inviteAttributes = "value=\"" + encodeURI(roomUrl) + "\"";
21 21
     }
22 22
 
23
+    let inviteLinkId = "inviteLinkRef";
24
+    let focusInviteLink = function() {
25
+        $('#' + inviteLinkId).focus();
26
+        $('#' + inviteLinkId).select();
27
+    };
28
+
23 29
     let title = APP.translation.generateTranslationHTML("dialog.shareLink");
24 30
     APP.UI.messageHandler.openTwoButtonDialog(
25 31
         null, title, null,
26
-        '<input id="inviteLinkRef" type="text" '
32
+        '<input id="' + inviteLinkId + '" type="text" '
27 33
             + inviteAttributes + ' readonly/>',
28 34
         false, "dialog.copy",
29 35
         function (e, v) {
30 36
             if (v && roomUrl) {
31 37
                 JitsiMeetJS.analytics.sendEvent('toolbar.invite.button');
38
+
39
+                focusInviteLink();
40
+
32 41
                 document.execCommand('copy');
33 42
             }
34 43
             else {
@@ -36,20 +45,21 @@ function openLinkDialog () {
36 45
             }
37 46
         },
38 47
         function (event) {
39
-            if (roomUrl) {
40
-                $('#inviteLinkRef').focus();
41
-                $('#inviteLinkRef').select();
42
-            } else {
48
+            if (!roomUrl) {
43 49
                 if (event && event.target) {
44 50
                     $(event.target).find('button[value=true]')
45 51
                         .prop('disabled', true);
46 52
                 }
47 53
             }
54
+            else {
55
+                focusInviteLink();
56
+            }
48 57
         },
49 58
         function (e, v, m, f) {
50 59
             if(!v && !m && !f)
51 60
                 JitsiMeetJS.analytics.sendEvent('toolbar.invite.close');
52
-        }
61
+        },
62
+        'Copy' // Focus Copy button.
53 63
     );
54 64
 }
55 65
 

+ 1
- 1
modules/UI/util/MessageHandler.js Прегледај датотеку

@@ -108,7 +108,7 @@ var messageHandler = {
108 108
             persistent: false,
109 109
             buttons: buttons,
110 110
             defaultButton: defaultButton,
111
-            focus: (focus && focus >= 0) ? focus : -1,
111
+            focus: (focus) ? focus : '',
112 112
             loaded: loadedFunction,
113 113
             submit: function (e, v, m, f) {
114 114
                 twoButtonDialog = null;

Loading…
Откажи
Сачувај