@@ -35,6 +35,39 @@ $(document).on('click', '.settings-app-tab', function(e){
35
35
}
36
36
} ) ;
37
37
38
+
39
+ $ ( document ) . on (
40
+ "click" ,
41
+ "#phoneNumberSelect, #serialNumberSelect" ,
42
+ function ( e ) {
43
+ // Get the title of the clicked element
44
+ var title = "" ;
45
+ if ( $ ( this ) . attr ( "id" ) == "phoneNumberSelect" ) {
46
+ title = "Phone Number" ;
47
+ } else {
48
+ title = "Serial Number" ;
49
+ }
50
+
51
+ // get the result id of myPhoneNumber or mySerialNumber
52
+ var textToCopy =
53
+ $ ( this ) . attr ( "id" ) == "phoneNumberSelect"
54
+ ? $ ( "#myPhoneNumber" ) . text ( )
55
+ : $ ( "#mySerialNumber" ) . text ( ) ;
56
+
57
+ // Copying the text to clipboard using Clipboard.js
58
+ var clipboard = new ClipboardJS ( this , {
59
+ text : function ( ) {
60
+ QB . Phone . Notifications . Add (
61
+ "fas fa-phone" ,
62
+ "Copied " + title + "!" ,
63
+ textToCopy
64
+ ) ;
65
+ return textToCopy ;
66
+ } ,
67
+ } ) ;
68
+ }
69
+ ) ;
70
+
38
71
$ ( document ) . on ( 'click' , '#accept-background' , function ( e ) {
39
72
e . preventDefault ( ) ;
40
73
var hasCustomBackground = QB . Phone . Functions . IsBackgroundCustom ( ) ;
@@ -190,4 +223,4 @@ $(document).on('click', '#cancel-profilepicture', function(e){
190
223
$ ( document ) . on ( 'click' , '#cancel-custom-profilepicture' , function ( e ) {
191
224
e . preventDefault ( ) ;
192
225
QB . Phone . Animations . TopSlideUp ( ".profilepicture-custom" , 200 , - 23 ) ;
193
- } ) ;
226
+ } ) ;
0 commit comments