OMG..lots of changes for sake of mobile login / user menu etc.
Feeling a bit sloppy right about now...oh well good enough
This commit is contained in:
parent
e3ae427e37
commit
ee0bdc4b74
10 changed files with 335 additions and 183 deletions
39
tailbone/static/js/tailbone.mobile.js
Normal file
39
tailbone/static/js/tailbone.mobile.js
Normal file
|
@ -0,0 +1,39 @@
|
|||
|
||||
/************************************************************
|
||||
*
|
||||
* tailbone.mobile.js
|
||||
*
|
||||
* Global logic for mobile app
|
||||
*
|
||||
************************************************************/
|
||||
|
||||
|
||||
$(function() {
|
||||
|
||||
// must init header/footer toolbars since ours are "external"
|
||||
$('[data-role="header"], [data-role="footer"]').toolbar({theme: 'a'});
|
||||
});
|
||||
|
||||
|
||||
$(document).on('pagecontainerchange', function(event, ui) {
|
||||
|
||||
// in some cases (i.e. when no user is logged in) we may want the (external)
|
||||
// header toolbar button to change between pages. here's how we do that.
|
||||
// note however that we do this *always* even when not technically needed
|
||||
var link = $('[data-role="header"] a');
|
||||
var newlink = ui.toPage.find('.replacement-header a');
|
||||
link.text(newlink.text());
|
||||
link.attr('href', newlink.attr('href'));
|
||||
link.removeClass('ui-icon-home ui-icon-user');
|
||||
link.addClass(newlink.attr('class'));
|
||||
});
|
||||
|
||||
|
||||
$(document).on('pageshow', function() {
|
||||
|
||||
// on login page, auto-focus username
|
||||
el = $('#username');
|
||||
if (el.is(':visible')) {
|
||||
el.focus();
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue