From 35bb0dba07a42fc6774b117ab207c0a6ca1009bf Mon Sep 17 00:00:00 2001 From: Max Pozdeev Date: Thu, 9 Sep 2010 11:41:39 +0400 Subject: [PATCH] + added task input placeholder --- src/mytinytodo.js | 4 ++++ src/themes/default/index.php | 5 ++++- src/themes/default/style.css | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mytinytodo.js b/src/mytinytodo.js index 343fd42..5563e2a 100644 --- a/src/mytinytodo.js +++ b/src/mytinytodo.js @@ -128,6 +128,10 @@ var mytinytodo = window.mytinytodo = _mtt = { if(event.keyCode == 27) { $(this).val(''); } + }).focusin(function(){ + $('#task_placeholder').removeClass('placeholding'); + }).focusout(function(){ + if('' == $(this).val()) $('#task_placeholder').addClass('placeholding'); }); diff --git a/src/themes/default/index.php b/src/themes/default/index.php index 18cd5c1..62c8a55 100644 --- a/src/themes/default/index.php +++ b/src/themes/default/index.php @@ -106,7 +106,10 @@ $().ready(function(){
- +
diff --git a/src/themes/default/style.css b/src/themes/default/style.css index eda8019..c22c225 100644 --- a/src/themes/default/style.css +++ b/src/themes/default/style.css @@ -107,6 +107,8 @@ a { color:#0000ff; cursor:pointer; text-decoration:underline; } .mtt-taskbox td.mtt-tb-cell { padding:0px; width:350px; } .mtt-tb-c { position:relative; padding-left:22px; /*input padding+border*/ } #task { color:#444444; background:#fff; height:1.35em; padding:2px; padding-right:18px; border:1px inset #F0F0F0; width:100%; margin-left:-22px; } +#task_placeholder span { display:none; color:#ccc; position:absolute; left:0; top:0; height:1.35em; line-height:1.35em; padding:3px; /*input top and left padding+border*/ } +#task_placeholder.placeholding span { display:inline-block; } .mtt-taskbox-icon { width:16px; height:16px; position:absolute; top:50%; margin-top:-8px; } .mtt-taskbox-icon.mtt-icon-submittask { background:url(images/mzl.png) 0px -32px no-repeat; right:4px; }