@@ -231,7 +231,7 @@ const ipc_listener = async (event, handled) => {
231
231
// create html
232
232
h += `<div style="padding: 10px 10px 2px;">` ;
233
233
h += `<div style="display:flex;">` ;
234
- h += `<input type="text" style="margin-bottom:10px;" class="social-url" readonly value="${ html_encode ( event . data . url ) } "/>` ;
234
+ h += `<input type="text" style="margin-bottom:10px; font-size: 13px; " class="social-url" readonly value="${ html_encode ( event . data . url ) } "/>` ;
235
235
h += `<button class="button copy-link" style="white-space:nowrap; text-align:center; white-space: nowrap; text-align: center; padding-left: 10px; padding-right: 10px; height: 33px; box-shadow: none; margin-left: 4px;">${ ( copy_icon ) } </button>` ;
236
236
h += `</div>` ;
237
237
@@ -247,7 +247,8 @@ const ipc_listener = async (event, handled) => {
247
247
let po = await UIPopover ( {
248
248
content : h ,
249
249
// snapToElement: this,
250
- // parent_element: this,
250
+ parent_element : $el_parent_window ,
251
+ parent_id : parent_window_id ,
251
252
// width: 300,
252
253
height : 100 ,
253
254
left : event . data . options . left ,
@@ -256,6 +257,8 @@ const ipc_listener = async (event, handled) => {
256
257
} ) ;
257
258
258
259
$ ( po ) . find ( '.copy-link' ) . on ( 'click' , function ( e ) {
260
+ e . preventDefault ( ) ;
261
+ e . stopPropagation ( ) ;
259
262
const url = $ ( po ) . find ( '.social-url' ) . val ( ) ;
260
263
navigator . clipboard . writeText ( url ) ;
261
264
// set checkmark
@@ -264,6 +267,8 @@ const ipc_listener = async (event, handled) => {
264
267
setTimeout ( function ( ) {
265
268
$ ( po ) . find ( '.copy-link' ) . html ( copy_icon )
266
269
} , 1000 ) ;
270
+
271
+ return false ;
267
272
} )
268
273
}
269
274
@@ -393,6 +398,13 @@ const ipc_listener = async (event, handled) => {
393
398
} ) ;
394
399
}
395
400
//--------------------------------------------------------
401
+ // mouseClicked
402
+ //--------------------------------------------------------
403
+ else if ( event . data . msg === 'mouseClicked' ) {
404
+ // close all popovers whose parent_id is parent_window_id
405
+ $ ( '.popover[data-parent_id="' + parent_window_id + '"]' ) . remove ( ) ;
406
+ }
407
+ //--------------------------------------------------------
396
408
// showDirectoryPicker
397
409
//--------------------------------------------------------
398
410
else if ( event . data . msg === 'showDirectoryPicker' ) {
@@ -488,7 +500,6 @@ const ipc_listener = async (event, handled) => {
488
500
// update mouse position
489
501
update_mouse_position ( x + window_position . left , y + window_position . top ) ;
490
502
}
491
-
492
503
//--------------------------------------------------------
493
504
// contextMenu
494
505
//--------------------------------------------------------
0 commit comments