From 6b26b1367f11071973a0b295e30e7a0f2fc20b81 Mon Sep 17 00:00:00 2001 From: Max Pozdeev Date: Mon, 28 Dec 2009 22:44:34 +0300 Subject: [PATCH] * fixed task edit in pda style --- src/ajax.js | 26 +++++++++++++++++++------- src/index.php | 11 +++++++---- src/pda.css | 8 ++++---- src/style.css | 4 +++- 4 files changed, 33 insertions(+), 16 deletions(-) diff --git a/src/ajax.js b/src/ajax.js index d5354e6..6bdb4ca 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -291,10 +291,6 @@ function editTask(id) function showEditForm(isAdd) { - $('
').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; + } + + $('
').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 = ''; diff --git a/src/index.php b/src/index.php index ac9baf9..0267652 100644 --- a/src/index.php +++ b/src/index.php @@ -71,7 +71,9 @@ $().ready(function(){ dayNames:lang.daysLong, monthNamesShort:lang.monthsLong }); $("#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)} }); + + flag.pda = true; }); @@ -151,8 +153,9 @@ $().ajaxStop( function(r,s) {$("#loading").fadeOut();} );
-
-  
+
+
+
@@ -164,7 +167,7 @@ $().ajaxStop( function(r,s) {$("#loading").fadeOut();} );
-
+
diff --git a/src/pda.css b/src/pda.css index b0af93a..20270bc 100644 --- a/src/pda.css +++ b/src/pda.css @@ -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;*/ } diff --git a/src/style.css b/src/style.css index 01f7233..2a60dcd 100644 --- a/src/style.css +++ b/src/style.css @@ -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; }