mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
make run() to parse anchor
This commit is contained in:
parent
d8a341cd52
commit
ac0d635ec1
3 changed files with 24 additions and 9 deletions
|
|
@ -39,7 +39,7 @@ $().ready(function(){
|
|||
calendarIcon: '<?php mttinfo('template_url'); ?>images/calendar.svg',
|
||||
autotag: <?php echo Config::get('autotag') ? "true" : "false"; ?>
|
||||
<?php if(Config::get('mobile')) echo ", touchDevice: true"; ?>
|
||||
}).loadLists();
|
||||
}).run();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ $().ready(function(){
|
|||
calendarIcon: '<?php mttinfo('template_url'); ?>images/calendar.png',
|
||||
autotag: <?php echo Config::get('autotag') ? "true" : "false"; ?>
|
||||
<?php if(Config::get('mobile')) echo ", touchDevice: true"; ?>
|
||||
}).loadLists();
|
||||
}).run();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -131,8 +131,6 @@ var mytinytodo = window.mytinytodo = _mtt = {
|
|||
if(this.options.showdate) $('#page_tasks').addClass('show-inline-date');
|
||||
if(this.options.singletab) $('#lists .mtt-tabs').addClass('mtt-tabs-only-one');
|
||||
|
||||
this.parseAnchor();
|
||||
|
||||
// handlers
|
||||
$('.mtt-tabs-add-button').click(function(){
|
||||
addList();
|
||||
|
|
@ -590,6 +588,23 @@ var mytinytodo = window.mytinytodo = _mtt = {
|
|||
setOptions: function(opts) {
|
||||
jQuery.extend(this.options, opts);
|
||||
},
|
||||
|
||||
run: function()
|
||||
{
|
||||
var path = this.parseAnchor();
|
||||
|
||||
if (flag.firstLoad) {
|
||||
updateAccessStatus();
|
||||
}
|
||||
|
||||
if (path.settings) {
|
||||
this.pages.current.onBack = function(){ this.loadLists(); }
|
||||
showSettings();
|
||||
}
|
||||
else {
|
||||
this.loadLists();
|
||||
}
|
||||
},
|
||||
|
||||
loadLists: function()
|
||||
{
|
||||
|
|
@ -661,10 +676,6 @@ var mytinytodo = window.mytinytodo = _mtt = {
|
|||
$('#page_tasks').show();
|
||||
|
||||
});
|
||||
|
||||
if (flag.firstLoad) {
|
||||
updateAccessStatus();
|
||||
}
|
||||
},
|
||||
|
||||
duedatepickerformat: function()
|
||||
|
|
@ -711,6 +722,7 @@ var mytinytodo = window.mytinytodo = _mtt = {
|
|||
this.pages.current = this.pages.prev.pop();
|
||||
showhide($('#page_'+ this.pages.current.page), $('#page_'+ prev.page).removeClass('mtt-page-'+prev.page.pageClass));
|
||||
$(window).scrollTop(this.pages.current.lastScrollTop);
|
||||
if (this.pages.current.onBack) this.pages.current.onBack.call(this);
|
||||
},
|
||||
|
||||
applySingletab: function(yesno)
|
||||
|
|
@ -791,6 +803,7 @@ var mytinytodo = window.mytinytodo = _mtt = {
|
|||
switch(s) {
|
||||
case "list": if(a[++i].match(/^-?\d+$/)) { p[s] = a[i]; } break;
|
||||
case "alltasks": p.list = '-1'; break;
|
||||
case "settings": p.settings = true; break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2371,7 +2384,9 @@ function saveSettings(frm)
|
|||
$.post(_mtt.mttUrl+'settings.php', params, function(json){
|
||||
if(json.saved) {
|
||||
flashInfo(_mtt.lang.get('settingsSaved'));
|
||||
setTimeout('window.location.reload();', 1000);
|
||||
setTimeout( function(){
|
||||
window.location.assign(_mtt.mttUrl); //window.location.reload();
|
||||
}, 1000);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue