mirror of
https://github.com/JanGross/quicknotes.git
synced 2025-12-01 07:37:18 +01:00
Use fullscreen modal on small screen. Issue #23
This commit is contained in:
13
js/script.js
13
js/script.js
@@ -267,11 +267,18 @@ View.prototype = {
|
||||
|
||||
note.css({"opacity": "0.1"});
|
||||
|
||||
var windowWidth = $(window).width();
|
||||
var modalWidth = note.width()*2;
|
||||
var modalTop = 150;
|
||||
if (windowWidth < modalWidth) {
|
||||
modalWidth = windowWidth;
|
||||
modalTop = 50;
|
||||
}
|
||||
$(".modal-content").animate (
|
||||
{
|
||||
left: ($(window).width() / 2 - note.width()),
|
||||
width: note.width()*2,
|
||||
top: 150,
|
||||
left: (windowWidth / 2 - modalWidth / 2),
|
||||
width: modalWidth,
|
||||
top: modalTop,
|
||||
},
|
||||
250,
|
||||
function () {
|
||||
|
||||
Reference in New Issue
Block a user