Skip to content

Commit

Permalink
nsMap.latLngAsModal: Dbl-click on latLng format => copy to clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
NielsHolt committed Oct 31, 2023
1 parent dbebc50 commit 2630500
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/latlng/latlng-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ Methods to adjust and display latLng-values
icon: 'fa-copy',
text: {da:'Kopier til udklipsholder', en:'Copy to Clipboard'},
}],
footer: window.bsIsTouch ? null : {
icon: 'far fa-computer-mouse',
text: {da: 'Dobbelt-klik på format for at kopier', en: 'Double click on format to copy'}
},
show: false
};

Expand All @@ -52,19 +56,25 @@ Methods to adjust and display latLng-values
formatItems = [];

for (var formatId = window.latLngFormat.LATLNGFORMAT_FIRST; formatId <= window.latLngFormat.LATLNGFORMAT_LAST; formatId++){

window.latLngFormat.setTempFormat(formatId);
formatItems.push({ text: window.latLngFormat.options.text[formatId] });


var formatList = latLng.outputs();
$.each(formatList, function(index, format){
var id = 'format'+formatId+index;
latLngFormats[id] = format;
formatItems.push({id: id, text: format});
formatItems.push({
id: id,
text: format,
onDblClick: function(){
//Trigger copy to clipboard
clipboard.onClick( {currentTarget: $('#btn_copy_to_clipboard').get(0)} );
}
});
});
}


window.latLngFormat.setTempFormat(saveCurrentFormatId);

modalOptions.content.push({
Expand Down

0 comments on commit 2630500

Please sign in to comment.