mirror of
https://github.com/pierre42100/comunic
synced 2024-11-16 18:41:13 +00:00
40 lines
1.0 KiB
JavaScript
Executable File
40 lines
1.0 KiB
JavaScript
Executable File
|
|
(function($){
|
|
$.Metro = function(params){
|
|
params = $.extend({
|
|
}, params);
|
|
};
|
|
|
|
$.Metro.getDeviceSize = function(){
|
|
var device_width = (window.innerWidth > 0) ? window.innerWidth : screen.width;
|
|
var device_height = (window.innerHeight > 0) ? window.innerHeight : screen.height;
|
|
return {
|
|
width: device_width,
|
|
height: device_height
|
|
}
|
|
}
|
|
|
|
})(jQuery);
|
|
|
|
$(function(){
|
|
$('html').on('click', function(e){
|
|
$('.dropdown-menu').each(function(i, el){
|
|
if (!$(el).hasClass('keep-open') && $(el).css('display')=='block') {
|
|
$(el).hide();
|
|
}
|
|
});
|
|
});
|
|
});
|
|
|
|
$(function(){
|
|
$(window).on('resize', function(){
|
|
if (METRO_DIALOG) {
|
|
var top = ($(window).height() - METRO_DIALOG.outerHeight()) / 2;
|
|
var left = ($(window).width() - METRO_DIALOG.outerWidth()) / 2;
|
|
METRO_DIALOG.css({
|
|
top: top, left: left
|
|
});
|
|
}
|
|
});
|
|
});
|