[virtualcommons-svn] commit/vcweb: alllee: pushing navbar javascript up to mobile/base and trying o
Status: Beta
Brought to you by:
alllee
From: Bitbucket <com...@bi...> - 2011-06-26 00:53:12
|
1 new changeset in vcweb: http://bitbucket.org/virtualcommons/vcweb/changeset/96e769becc27/ changeset: 96e769becc27 user: alllee date: 2011-06-26 02:53:05 summary: pushing navbar javascript up to mobile/base and trying out .delegate instead of .live, renamed lpbase.html to divpage.html and moved to core/templates/mobile affected #: 7 files (1.5 KB) --- a/.hgignore Sat Jun 25 13:06:22 2011 -0700 +++ b/.hgignore Sat Jun 25 17:53:05 2011 -0700 @@ -11,4 +11,4 @@ build logs tmp -.orig +*.orig --- a/vcweb/core/templates/mobile/base.html Sat Jun 25 13:06:22 2011 -0700 +++ b/vcweb/core/templates/mobile/base.html Sat Jun 25 17:53:05 2011 -0700 @@ -8,6 +8,22 @@ <script type="text/javascript" src="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.js"></script><link href="{{STATIC_URL}}css/mobile.css" rel="stylesheet" type="text/css" media="screen" /><!-- vcweb common js --> + <script type='text/javascript'> + // maintain active button state + $(document).delegate("div:jqmData(role='page')", 'pageshow', function() { + console.debug("window location hash is " + window.location.hash); + if (window.location.hash) { + $(this).find("div:jqmData(role='navbar') a").each(function() { + if ($(this).attr('href') == window.location.hash) { + $(this).addClass('ui-btn-active ui-state-persist'); + } + else { + $(this).removeClass('ui-btn-active ui-state-persist'); + } + }); + } + }); + </script> {% endblock %} </head><body> --- a/vcweb/lighterprints/templates/lighterprints/mobile/full-activity-list.html Sat Jun 25 13:06:22 2011 -0700 +++ b/vcweb/lighterprints/templates/lighterprints/mobile/full-activity-list.html Sat Jun 25 17:53:05 2011 -0700 @@ -1,4 +1,4 @@ -{% extends "lighterprints/mobile/lpbase.html" %} +{% extends "mobile/divpage.html" %} {% block page_id %}full-activity-list{% endblock page_id %} {% block content %} --- a/vcweb/lighterprints/templates/lighterprints/mobile/index.html Sat Jun 25 13:06:22 2011 -0700 +++ b/vcweb/lighterprints/templates/lighterprints/mobile/index.html Sat Jun 25 17:53:05 2011 -0700 @@ -1,16 +1,6 @@ {% extends "mobile/base.html" %} {% block head %} {{ block.super }} -<script type='text/javascript'> - // maintain active button state - $("div:jqmData(role='page')").live('pageshow', function (event) { - console.debug("window location hash is " + window.location.hash); - if (window.location.hash) { - $('#navbar a').removeClass('ui-btn-active'); - $('#navbar a[href="' + window.location.hash + '"]').addClass('ui-btn-active'); - } - }); -</script> {% endblock head %} {% block title %} --- a/vcweb/lighterprints/templates/lighterprints/mobile/lpbase.html Sat Jun 25 13:06:22 2011 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -<div data-role='page' id='{% block page_id %}home{% endblock %}'> - {% block header %} - {% include "lighterprints/mobile/header.html" %} - {% endblock header %} - {% block content %} - {% endblock content %} - {% block footer %} - {% include "lighterprints/mobile/footer.html" %} - {% endblock footer %} -</div> --- a/vcweb/lighterprints/templates/lighterprints/mobile/navbar.html Sat Jun 25 13:06:22 2011 -0700 +++ b/vcweb/lighterprints/templates/lighterprints/mobile/navbar.html Sat Jun 25 17:53:05 2011 -0700 @@ -1,8 +1,8 @@ -<div data-role='navbar' id='navbar'> +<div data-role='navbar'><ul> - <li><a href='#home-screen' data-role='button' data-icon='home' class='ui-btn-active' data-transition='fade'>Home</a></li> - <li><a href='#full-activity-list' data-role='button' data-icon='grid' data-transition='slide'>All activities</a></li> - <li><a href='#group-performance' data-role='button' data-icon='group' data-transition='pop'>Group performance</a></li> + <li><a href='#home-screen' data-role='button' data-icon='home' data-transition='fade'>Home</a></li> + <li><a href='#full-activity-list' data-role='button' data-icon='grid' data-transition='fade'>All activities</a></li> + <li><a href='#group-performance' data-role='button' data-icon='group' data-transition='fade'>Group performance</a></li></ul></div> Repository URL: https://bitbucket.org/virtualcommons/vcweb/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |