mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
* fixed task edit in pda style
This commit is contained in:
parent
eb14a086d0
commit
6b26b1367f
4 changed files with 33 additions and 16 deletions
26
src/ajax.js
26
src/ajax.js
|
|
@ -291,10 +291,6 @@ function editTask(id)
|
|||
|
||||
function showEditForm(isAdd)
|
||||
{
|
||||
$('<div id="overlay"></div>').appendTo('body').css('opacity', 0.5).show();
|
||||
//clear selection
|
||||
if(document.selection && document.selection.empty && document.selection.createRange().text) document.selection.empty();
|
||||
else if(window.getSelection) window.getSelection().removeAllRanges();
|
||||
if(isAdd) {
|
||||
$('#page_taskedit').removeClass('mtt-inedit').addClass('mtt-inadd');
|
||||
document.edittask.isadd.value = 1;
|
||||
|
|
@ -303,6 +299,17 @@ function showEditForm(isAdd)
|
|||
$('#page_taskedit').removeClass('mtt-inadd').addClass('mtt-inedit');
|
||||
document.edittask.isadd.value = 0;
|
||||
}
|
||||
|
||||
if(flag.pda) {
|
||||
showhide($('#page_taskedit'), $('#page_tasks'));
|
||||
return;
|
||||
}
|
||||
|
||||
$('<div id="overlay"></div>').appendTo('body').css('opacity', 0.5).show();
|
||||
//clear selection
|
||||
if(document.selection && document.selection.empty && document.selection.createRange().text) document.selection.empty();
|
||||
else if(window.getSelection) window.getSelection().removeAllRanges();
|
||||
|
||||
var w = $('#page_taskedit');
|
||||
if(!flag.windowTaskEditMoved)
|
||||
{
|
||||
|
|
@ -327,9 +334,14 @@ function showEditForm(isAdd)
|
|||
function cancelEdit(e)
|
||||
{
|
||||
if(e && e.keyCode != 27) return;
|
||||
$(document).unbind('keydown', cancelEdit);
|
||||
$('#page_taskedit').hide();
|
||||
$('#overlay').remove();
|
||||
if(flag.pda) {
|
||||
showhide($('#page_tasks'), $('#page_taskedit'));
|
||||
} else
|
||||
{
|
||||
$(document).unbind('keydown', cancelEdit);
|
||||
$('#page_taskedit').hide();
|
||||
$('#overlay').remove();
|
||||
}
|
||||
document.edittask.task.value = '';
|
||||
document.edittask.note.value = '';
|
||||
document.edittask.tags.value = '';
|
||||
|
|
|
|||
|
|
@ -71,7 +71,9 @@ $().ready(function(){
|
|||
dayNames:lang.daysLong, monthNamesShort:lang.monthsLong });
|
||||
<?php if(!isset($_GET['pda'])): ?>
|
||||
$("#page_taskedit").draggable({ handle:'h3', stop: function(e,ui){ flag.windowTaskEditMoved=true; tmp.editformpos=[$(this).css('left'),$(this).css('top')]; } });
|
||||
$("#page_taskedit").resizable({ minWidth:$("#page_taskedit").width(), minHeight:$("#page_taskedit").height(), start:function(ui,e){editFormResize(1)}, resize:function(ui,e){editFormResize(0,e)}, stop:function(ui,e){editFormResize(2,e)} });
|
||||
$("#page_taskedit").resizable({ minWidth:$("#page_taskedit").width(), minHeight:220, start:function(ui,e){editFormResize(1)}, resize:function(ui,e){editFormResize(0,e)}, stop:function(ui,e){editFormResize(2,e)} });
|
||||
<?php else: ?>
|
||||
flag.pda = true;
|
||||
<?php endif; ?>
|
||||
|
||||
});
|
||||
|
|
@ -151,8 +153,9 @@ $().ajaxStop( function(r,s) {$("#loading").fadeOut();} );
|
|||
<form onSubmit="return saveTask(this)" name="edittask">
|
||||
<input type="hidden" name="isadd" value="0">
|
||||
<input type="hidden" name="id" value="">
|
||||
<div class="form-row"><span class="h"><?php _e('priority');?></span> <SELECT name="prio"><option value="2">+2</option><option value="1">+1</option><option value="0" selected>±0</option><option value="-1">−1</option></SELECT>
|
||||
<span class="h"><?php _e('due');?> </span> <input name="duedate" id="duedate" value="" class="in100" title="Y-M-D, M/D/Y, D.M.Y, M/D, D.M" autocomplete="off"></div>
|
||||
<div class="form-row form-row-short"><span class="h"><?php _e('priority');?></span> <SELECT name="prio"><option value="2">+2</option><option value="1">+1</option><option value="0" selected>±0</option><option value="-1">−1</option></SELECT></div>
|
||||
<div class="form-row form-row-short"><span class="h"><?php _e('due');?> </span> <input name="duedate" id="duedate" value="" class="in100" title="Y-M-D, M/D/Y, D.M.Y, M/D, D.M" autocomplete="off"></div>
|
||||
<div class="form-row-short-end"></div>
|
||||
<div class="form-row"><div class="h"><?php _e('task');?></div> <input type="text" name="task" value="" class="in500" maxlength="250"></div>
|
||||
<div class="form-row"><div class="h"><?php _e('note');?></div> <textarea name="note" class="in500"></textarea></div>
|
||||
<div class="form-row"><div class="h"><?php _e('tags');?></div>
|
||||
|
|
@ -164,7 +167,7 @@ $().ajaxStop( function(r,s) {$("#loading").fadeOut();} );
|
|||
</tr></table>
|
||||
</div>
|
||||
<div class="form-row" id="alltags" style="display:none;"><?php _e('alltags');?> <span class="tags-list"></span></div>
|
||||
<div class="form-row"><input type="submit" value="<?php _e('save');?>" onClick="this.blur()"> <input type="button" value="<?php _e('cancel');?>" onClick="cancelEdit();this.blur();return false"></div>
|
||||
<div class="form-row form-bottom-buttons"><input type="submit" value="<?php _e('save');?>" onClick="this.blur()"> <input type="button" value="<?php _e('cancel');?>" onClick="cancelEdit();this.blur();return false"></div>
|
||||
</form>
|
||||
|
||||
</div> <!-- end of page_taskedit -->
|
||||
|
|
|
|||
|
|
@ -31,10 +31,10 @@ h3 { margin-bottom:4px; padding:4px 0; }
|
|||
.task-toggle { display:none; }
|
||||
.task-middle { margin-left:25px; }
|
||||
|
||||
#page_taskedit { max-width:100%; padding:0px; }
|
||||
.form-table { width:100%; }
|
||||
.form-table .in500 { width:95%; max-width:500px; color:#444444; }
|
||||
.form-table textarea { height: 70px; }
|
||||
#page_taskedit { max-width:99.5%; border:none; position:static; padding:0; }
|
||||
#page_taskedit .form-table { width:100%; }
|
||||
#page_taskedit .form-row .in500 { color:#444444; }
|
||||
#page_taskedit .form-row textarea { height: 70px; }
|
||||
|
||||
#loading { padding:0px; padding-top:1px; padding-right:1px; height:16px; overflow:hidden; }
|
||||
#loading img { /*width:8px; height:8px;*/ }
|
||||
|
|
|
|||
|
|
@ -111,12 +111,14 @@ li.task-completed .task-note-block .task-note { text-decoration:line-through; }
|
|||
.prio-o { background-color:#dedede; }
|
||||
.task-prio.prio-o { display:none; }
|
||||
|
||||
.form-row { margin-top:4px; margin-bottom:4px; }
|
||||
.form-row { margin-top:8px; }
|
||||
.form-row .h { font-weight:bold; color:#333333; }
|
||||
.form-row-short-end { clear:both; }
|
||||
#overlay { position:fixed; z-index:200; background-color:#111111; display:none; top:0px; left:0px; width:100%; height:100%; }
|
||||
#page_taskedit { position:fixed; z-index:201; background-color:#fdfdfd; padding:8px; border:1px solid #cccccc; width:510px; }
|
||||
#page_taskedit .form-row .in500 { width:99%; }
|
||||
#page_taskedit .form-row textarea.in500 { height:130px; /*resize:none;*/ }
|
||||
#page_taskedit .form-row-short { float:left; margin-right:12px; }
|
||||
.ui-icon-gripsmall-diagonal-se { background:url(images/icons.gif) 0 -16px; }
|
||||
#alltags .tag { font-weight:bold; color:#333333; }
|
||||
#alltags .tag:hover { background-color:#999988; color:white; }
|
||||
|
|
|
|||
Loading…
Reference in a new issue