Selaa lähdekoodia

Fixes the copy action.

j8
yanas 8 vuotta sitten
vanhempi
commit
b54f92b2ae
2 muutettua tiedostoa jossa 17 lisäystä ja 7 poistoa
  1. 16
    6
      modules/UI/toolbars/Toolbar.js
  2. 1
    1
      modules/UI/util/MessageHandler.js

+ 16
- 6
modules/UI/toolbars/Toolbar.js Näytä tiedosto

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

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

Loading…
Peruuta
Tallenna