mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
* edit task box width fixed to fit into window
This commit is contained in:
parent
fdeeb2bc55
commit
08f02ba2d3
1 changed files with 3 additions and 9 deletions
12
src/ajax.js
12
src/ajax.js
|
|
@ -313,20 +313,14 @@ function showEditForm(isAdd)
|
|||
var w = $('#page_taskedit');
|
||||
if(!flag.windowTaskEditMoved)
|
||||
{
|
||||
var x,y;
|
||||
if(document.getElementById('viewport')) {
|
||||
x = Math.floor(Math.min($(window).width(),screen.width)/2 - w.outerWidth()/2);
|
||||
y = Math.floor(Math.min($(window).height(),screen.height)/2 - w.outerHeight()/2);
|
||||
}
|
||||
else {
|
||||
x = Math.floor($(window).width()/2 - w.outerWidth()/2);
|
||||
y = Math.floor($(window).height()/2 - w.outerHeight()/2);
|
||||
}
|
||||
var x = Math.floor($(window).width()/2 - w.outerWidth()/2);
|
||||
var y = Math.floor($(window).height()/2 - w.outerHeight()/2);
|
||||
if(x < 0) x = 0;
|
||||
if(y < 0) y = 0;
|
||||
w.css({left:x, top:y});
|
||||
tmp.editformpos = [x, y];
|
||||
}
|
||||
w.css('max-width', $(window).width() - (w.outerWidth() - w.width()));
|
||||
w.fadeIn('fast'); //.show();
|
||||
$(document).bind('keydown', cancelEdit);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue