0
0
mirror of https://github.com/lipis/flag-icons.git synced 2024-11-28 00:36:23 +01:00
flags/assets/docs.js

14 lines
482 B
JavaScript
Raw Normal View History

2013-09-27 00:40:54 +02:00
window.onload = function () {
2015-08-31 03:07:13 +02:00
$('.all-flags .flag-icon-background').click(function(event){
const flag = $(event.currentTarget).attr('title');
const w = 640;
const h = 480;
const left = window.outerWidth / 2 + window.screenX - ( w / 2);
const top = window.outerHeight / 2 + window.screenY - ( h / 2);
2015-08-31 03:07:13 +02:00
if (flag) {
2015-08-31 03:09:26 +02:00
window.open('flags/4x3/' + flag + '.svg', 'flag-4x3', 'width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
2015-08-31 03:07:13 +02:00
}
});
2013-09-27 00:40:54 +02:00
}