mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
* optimized calls of updateAccessStatus()
This commit is contained in:
parent
5a0ad4e3a0
commit
44746f7ce7
3 changed files with 7 additions and 17 deletions
12
src/ajax.js
12
src/ajax.js
|
|
@ -487,8 +487,7 @@ function doAuth(form)
|
|||
if(json.logged)
|
||||
{
|
||||
flag.isLogged = true;
|
||||
updateAccessStatus();
|
||||
loadLists();
|
||||
loadLists(0,1);
|
||||
}
|
||||
else {
|
||||
flashError(lang.invalidpass);
|
||||
|
|
@ -505,8 +504,7 @@ function logout()
|
|||
resetAjaxErrorTrigger();
|
||||
}, 'json');
|
||||
flag.isLogged = false;
|
||||
updateAccessStatus();
|
||||
loadLists();
|
||||
loadLists(0,1);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -900,7 +898,7 @@ function toggleAllNotes(show)
|
|||
}
|
||||
}
|
||||
|
||||
function loadLists(onInit)
|
||||
function loadLists(onInit, updAccess)
|
||||
{
|
||||
if(filter.search != '') {
|
||||
filter.search = '';
|
||||
|
|
@ -939,12 +937,14 @@ function loadLists(onInit)
|
|||
$('#page_tasks h3').children().addClass('invisible');
|
||||
$('#mylistscontainer .mtt-need-list').addClass('mtt-disabled');
|
||||
$('#rss_icon').hide();
|
||||
if(flag.needAuth && !flag.isLogged) $('#page_tasks').hide();
|
||||
}
|
||||
ti += '<li class="mtt-tabs-button menu-owner"><a href="#" id="mylists" onClick="btnMenu(this);return false;"><span><img src="images/arrdown.gif"></span></a></li>';
|
||||
$('#lists>ul').html(ti);
|
||||
$('#lists').show();
|
||||
});
|
||||
$('#page_tasks').hide();
|
||||
$('#tasklist').html('');
|
||||
if(updAccess) updateAccessStatus();
|
||||
}
|
||||
|
||||
function addList()
|
||||
|
|
|
|||
|
|
@ -63,9 +63,8 @@ $().ready(function(){
|
|||
{
|
||||
echo "\tflag.needAuth = true;\n";
|
||||
if(is_logged()) echo "\tflag.isLogged = true;\n";
|
||||
echo "\tupdateAccessStatus();\n";
|
||||
}
|
||||
echo "\tloadLists(1);\n";
|
||||
echo "\tloadLists(1, 1);\n";
|
||||
?>
|
||||
preloadImg();
|
||||
$("#duedate").datepicker({dateFormat: '<?php echo $duedateformat; ?>', firstDay: <?php echo $config['firstdayofweek']; ?>,
|
||||
|
|
|
|||
|
|
@ -40,15 +40,6 @@ if($needAuth && !isset($dontStartSession))
|
|||
session_start();
|
||||
}
|
||||
|
||||
/*
|
||||
function canAllRead()
|
||||
{
|
||||
global $config;
|
||||
if(!isset($config['password']) || $config['password'] == '') return true;
|
||||
if(isset($config['allowread']) && $config['allowread']) return true;
|
||||
return false;
|
||||
}*/
|
||||
|
||||
function is_logged()
|
||||
{
|
||||
if(!isset($_SESSION['logged']) || !$_SESSION['logged']) return false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue