mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
* Taskview and Sorting menus converted to .mtt-btnmenu
This commit is contained in:
parent
e0738812bc
commit
62ee0ded12
3 changed files with 25 additions and 74 deletions
54
src/ajax.js
54
src/ajax.js
|
|
@ -606,21 +606,6 @@ function prioClick(prio, el)
|
|||
$('#taskrow_'+objPrio.taskId).effect("highlight", {color:theme.editTaskFlashColor}, 'normal');
|
||||
}
|
||||
|
||||
function showSort(el)
|
||||
{
|
||||
var w = $('#sortform');
|
||||
if(w.css('display') == 'none')
|
||||
{
|
||||
var offset = $(el).offset();
|
||||
w.css({ position: 'absolute', top: offset.top+el.offsetHeight-1, left: offset.left , 'min-width': $(el).width() }).show();
|
||||
$(document).bind("click", sortClose);
|
||||
}
|
||||
else {
|
||||
el.blur();
|
||||
sortClose();
|
||||
}
|
||||
}
|
||||
|
||||
function setSort(v, init)
|
||||
{
|
||||
if(v == 0) $('#sort>.btnstr').text($('#sortByHand').text());
|
||||
|
|
@ -649,15 +634,6 @@ function setSort(v, init)
|
|||
}
|
||||
}
|
||||
|
||||
function sortClose(e)
|
||||
{
|
||||
if(e) {
|
||||
if(isParentId(e.target, ['sortform','sort'])) return;
|
||||
}
|
||||
$(document).unbind("click", sortClose);
|
||||
$('#sortform').hide();
|
||||
}
|
||||
|
||||
function isParentId(el, id)
|
||||
{
|
||||
if(el.id && $.inArray(el.id, id) != -1) return true;
|
||||
|
|
@ -785,36 +761,12 @@ function refreshTaskCnt()
|
|||
$('#cnt_soon').text(taskCnt.soon);
|
||||
}
|
||||
|
||||
function showTaskview(el)
|
||||
{
|
||||
var w = $('#taskview');
|
||||
if(w.css('display') == 'none')
|
||||
{
|
||||
var offset = $(el).offset();
|
||||
w.css({ position: 'absolute', top: offset.top+el.offsetHeight-1, left: offset.left , 'min-width': $(el).width() }).show();
|
||||
$(document).bind("click", taskviewClose);
|
||||
}
|
||||
else {
|
||||
el.blur();
|
||||
taskviewClose();
|
||||
}
|
||||
}
|
||||
|
||||
function taskviewClose(e)
|
||||
{
|
||||
if(e) {
|
||||
if(isParentId(e.target, ['taskviewcontainer','taskview'])) return;
|
||||
}
|
||||
$(document).unbind("click", taskviewClose);
|
||||
$('#taskview').hide();
|
||||
}
|
||||
|
||||
function setTaskview(v, dontLoadTasks)
|
||||
{
|
||||
if(v == 0)
|
||||
{
|
||||
if(filter.due == '' && filter.compl == 0) return;
|
||||
$('#taskviewcontainer .btnstr').text($('#view_tasks').text());
|
||||
$('#taskview .btnstr').text($('#view_tasks').text());
|
||||
if(filter.due != '') {
|
||||
$('#tasklist').removeClass('filter-'+filter.due);
|
||||
filter.due = '';
|
||||
|
|
@ -829,7 +781,7 @@ function setTaskview(v, dontLoadTasks)
|
|||
else if(v == 1)
|
||||
{
|
||||
if(filter.due == '' && filter.compl == 1) return;
|
||||
$('#taskviewcontainer .btnstr').text($('#view_compl').text());
|
||||
$('#taskview .btnstr').text($('#view_compl').text());
|
||||
if(filter.due != '') {
|
||||
$('#tasklist').removeClass('filter-'+filter.due);
|
||||
filter.due = '';
|
||||
|
|
@ -848,7 +800,7 @@ function setTaskview(v, dontLoadTasks)
|
|||
$('#tasklist').removeClass('filter-'+filter.due);
|
||||
}
|
||||
$('#tasklist').addClass('filter-'+v);
|
||||
$('#taskviewcontainer .btnstr').text($('#view_'+v).text());
|
||||
$('#taskview .btnstr').text($('#view_'+v).text());
|
||||
$('#total').text(taskCnt[v]);
|
||||
filter.due = v;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -128,8 +128,8 @@ $().ajaxStop( function(r,s) {$("#loading").fadeOut();} );
|
|||
</div>
|
||||
|
||||
<h3>
|
||||
<span id="sort" onClick="showSort(this);" style="float:right"><span class="btnstr"></span> <img src="images/arrdown.gif"></span>
|
||||
<span id="taskviewcontainer" onClick="showTaskview(this);"><span class="btnstr"><?php _e('tasks');?></span> (<span id="total">0</span>) <img src="images/arrdown.gif"></span>
|
||||
<span id="sort" onClick="btnMenu(this);return false;" style="float:right" class="mtt-btnmenu"><span class="btnstr"></span> <img src="images/arrdown.gif"></span>
|
||||
<span id="taskview" onClick="btnMenu(this);return false;" class="mtt-btnmenu"><span class="btnstr"><?php _e('tasks');?></span> (<span id="total">0</span>) <img src="images/arrdown.gif"></span>
|
||||
<span id="tagcloudbtn" onClick="showTagCloud(this);"><span class="btnstr"><?php _e('tags');?></span> <img src="images/arrdown.gif"></span>
|
||||
<span class="mtt-notes-showhide"><?php _e('notes');?> <a href="#" onClick="toggleAllNotes(1);this.blur();return false;"><?php _e('notes_show');?></a> / <a href="#" onClick="toggleAllNotes(0);this.blur();return false;"><?php _e('notes_hide');?></a></span>
|
||||
</h3>
|
||||
|
|
@ -178,18 +178,22 @@ $().ajaxStop( function(r,s) {$("#loading").fadeOut();} );
|
|||
<span class="prio-pos" onClick="prioClick(1,this)">+1</span> <span class="prio-pos" onClick="prioClick(2,this)">+2</span>
|
||||
</div>
|
||||
|
||||
<div id="taskview" style="display:none">
|
||||
<div class="li" onClick="setTaskview(0);taskviewClose();"><span id="view_tasks"><?php _e('tasks');?></span></div>
|
||||
<div class="li" onClick="setTaskview(1);taskviewClose();"><span id="view_compl"><?php _e('tasks_and_compl');?></span></div>
|
||||
<div class="li" onClick="setTaskview('past');taskviewClose();"><span id="view_past"><?php _e('f_past');?></span> (<span id="cnt_past">0</span>)</div>
|
||||
<div class="li" onClick="setTaskview('today');taskviewClose();"><span id="view_today"><?php _e('f_today');?></span> (<span id="cnt_today">0</span>)</div>
|
||||
<div class="li" onClick="setTaskview('soon');taskviewClose();"><span id="view_soon"><?php _e('f_soon');?></span> (<span id="cnt_soon">0</span>)</div>
|
||||
<div id="taskviewcontainer" class="mtt-btnmenu-container" style="display:none">
|
||||
<ul>
|
||||
<li onClick="setTaskview(0)"><span id="view_tasks"><?php _e('tasks');?></span></li>
|
||||
<li onClick="setTaskview(1)"><span id="view_compl"><?php _e('tasks_and_compl');?></span></li>
|
||||
<li onClick="setTaskview('past')"><span id="view_past"><?php _e('f_past');?></span> (<span id="cnt_past">0</span>)</li>
|
||||
<li onClick="setTaskview('today')"><span id="view_today"><?php _e('f_today');?></span> (<span id="cnt_today">0</span>)</li>
|
||||
<li onClick="setTaskview('soon')"><span id="view_soon"><?php _e('f_soon');?></span> (<span id="cnt_soon">0</span>)</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="sortform" style="display:none">
|
||||
<div id="sortByHand" class="li" onClick="setSort(0);sortClose();"><?php _e('sortByHand');?></div>
|
||||
<div id="sortByPrio" class="li" onClick="setSort(1);sortClose();"><?php _e('sortByPriority');?></div>
|
||||
<div id="sortByDueDate" class="li" onClick="setSort(2);sortClose();"><?php _e('sortByDueDate');?></div>
|
||||
<div id="sortcontainer" class="mtt-btnmenu-container" style="display:none">
|
||||
<ul>
|
||||
<li id="sortByHand" onClick="setSort(0)"><?php _e('sortByHand');?></li>
|
||||
<li id="sortByPrio" onClick="setSort(1)"><?php _e('sortByPriority');?></li>
|
||||
<li id="sortByDueDate" onClick="setSort(2)"><?php _e('sortByDueDate');?></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="tagcloud" style="display:none">
|
||||
|
|
|
|||
|
|
@ -49,11 +49,7 @@ a { color:#0000ff; }
|
|||
#msg.mtt-info .msg-text { background-color:#EFC300; }
|
||||
#msg.mtt-info .msg-details { border:1px solid #EFC300;}
|
||||
|
||||
#sort { margin-left:5px; font-size:8pt; font-weight:normal; border-bottom:1px dashed #ccc; padding:2px; cursor:pointer; -moz-user-select:none; -webkit-user-select: none; }
|
||||
#sort:hover { border-bottom:1px solid #bbb; }
|
||||
#sortform { overflow: hidden; z-index:101; background-color:#f9f9f9; border:1px solid #cccccc; padding:3px; }
|
||||
#sortform .li { margin:1px 0px; padding:2px; cursor:pointer; }
|
||||
#sortform .li:hover { background-color:#316AC5; color:white; }
|
||||
#sort { margin-left:5px; font-size:8pt; font-weight:normal; }
|
||||
#page_tasks.readonly #sort { display:none; }
|
||||
|
||||
.mtt-notes-showhide { font-size:8pt; font-weight:normal; margin-left:5px; }
|
||||
|
|
@ -154,6 +150,8 @@ div.task-note-area textarea { color:#999999; width:100%; display:block; height:6
|
|||
#tagcloudcancel { border:1px solid #cccccc; padding:2px; margin-bottom:4px; cursor:pointer; background-color:#fdfdfd; }
|
||||
#tagcloudcancel:hover { border-color:#aaaaaa; }
|
||||
|
||||
#taskview { padding:1px 2px; }
|
||||
|
||||
.ui-datepicker { width:180px; z-index:202; border: 1px solid #cccccc; background: #ffffff; display:none; padding:2px; }
|
||||
.ui-datepicker-trigger { cursor:pointer; vertical-align:text-bottom; margin-left:1px; }
|
||||
.ui-datepicker-calendar { width:100%; border-collapse:collapse; }
|
||||
|
|
@ -169,12 +167,6 @@ div.task-note-area textarea { color:#999999; width:100%; display:block; height:6
|
|||
.ui-datepicker-title { text-align:center; }
|
||||
.ui-datepicker-prev, .ui-datepicker-next { cursor:pointer; padding:0px 3px; }
|
||||
|
||||
#taskviewcontainer { border-bottom:1px dashed #ccc; padding:1px 2px; }
|
||||
#taskviewcontainer:hover { cursor:pointer; border-bottom:1px solid #bbb; }
|
||||
#taskview { overflow: hidden; z-index:103; background-color:#f9f9f9; border:1px solid #cccccc; padding:3px; }
|
||||
#taskview .li { margin:1px 0px; padding:2px; cursor:pointer; }
|
||||
#taskview .li:hover { background-color:#316AC5; color:white; }
|
||||
|
||||
.ui-resizable { position:relative;}
|
||||
.ui-resizable-handle { position:absolute; font-size:0.1px; z-index:99999; display:block;}
|
||||
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display:none; }
|
||||
|
|
@ -182,6 +174,9 @@ div.task-note-area textarea { color:#999999; width:100%; display:block; height:6
|
|||
.ui-resizable-e { cursor:e-resize; width:7px; right:-5px; top:0px; height:100%; }
|
||||
.ui-resizable-se { cursor:se-resize; width:12px; height:12px; right:1px; bottom:1px; }
|
||||
|
||||
.mtt-btnmenu { border-bottom:1px dashed #ccc; padding:2px 2px; -moz-user-select:none; -webkit-user-select: none; }
|
||||
.mtt-btnmenu:hover { cursor:pointer; border-bottom:1px solid #bbb; }
|
||||
|
||||
.mtt-btnmenu-container { overflow: hidden; z-index:103; background-color:#f9f9f9; border:1px solid #cccccc; padding:3px; }
|
||||
.mtt-btnmenu-container ul { list-style: none; padding:0; margin:0; }
|
||||
.mtt-btnmenu-container li { margin:1px 0px; padding:2px; cursor:pointer; color:#000; }
|
||||
|
|
|
|||
Loading…
Reference in a new issue