Skip to content
Browse files

getting closer to having map info acutally be a link after ajax refresh

  • Loading branch information...
1 parent 07a435b commit 0159e7eddfa3035d0eaf4ef46d95abb831bb586d @ahsteele ahsteele committed
Showing with 12 additions and 12 deletions.
  1. +11 −11 geocamTalk/templates/geocamTalk/base.html
  2. +1 −1 geocamTalk/templates/geocamTalk/message_list.html
View
22 geocamTalk/templates/geocamTalk/base.html
@@ -10,7 +10,7 @@
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.css" />
<link rel="stylesheet" href="/resources/css/jquery.mobile.css" />
<link rel="stylesheet" href="/resources/css/site.css" />
- <script src="http://code.jquery.com/jquery-1.5.min.js"></script>
+ <script src="http://code.jquery.com/jquery-1.5.2.min.js"></script>
<script src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
$(document).bind("mobileinit", function () {
@@ -57,37 +57,37 @@
+ " " + msgDate.getHours() + ":" + msgDate.getMinutes();
html_str += '<li id="message_'+pk+'"><p id="message_'+pk+'_header">';
- html_str += 'On '+content_timestamp+' '+authorFullname+' said';
+ html_str += 'On '+content_timestamp+' '+authorFullname;
if (has_geolocation == true) {
- html_str += '<a data-rel="dialog" data-transition="pop" data-inline="true" data-role="button" data-icon="geoCam-map" data-iconpos="notext">Map Info</a>';
+ html_str += '<a href="#" data-rel="dialog" data-transition="pop" data-inline="true" data-role="button" data-icon="geoCam-map" data-iconpos="notext">Map Info</a>';
}
html_str += '</p>';
html_str += '<p id="message_'+pk+'_content">'+content+'</p>';
html_str += '</li>';
}
- $.mobile.activePage.page().find('#message_list').prepend(html_str);
running_timestamp = data['ts'];
new_message_count += data['msgCnt'];
-
- $.mobile.pageContainer.find('div[data-role="page"]').each(function(i) {
- $(this).find('#new_message_count').html(new_message_count);
+ //mobile.pageContainer.find
+ $('div[data-role="page"]').each(function(i) {
+ $(this).find('#message_list').prepend(html_str);
+ $(this).find('#new_message_count').html(new_message_count);
});
-
+
if (new_message_count > 0
- && $.mobile.activePage.page().find('#clear_link').length == 0) {
+ && $('div[data-role="page"]').find('#clear_link').length == 0) {
var link = $('<li><a id="clear_link" href="#">(Clear)</a></li>');
link.click(function() {
$.get('{% url geocamTalk.views.clear_messages %}', function() {
new_message_count = 0;
- $.mobile.pageContainer.find('div[data-role="page"]').each(function(i) {
+ $('div[data-role="page"]').each(function(i) {
$(this).find('#new_message_count').html(0);
$(this).find('#clear_link').remove();
});
});
});
- $.mobile.activePage.page().find('#my_messages_link').parent().after(link);
+ $('div[data-role="page"]').find('#my_messages_link').parent().after(link);
}
});
};
View
2 geocamTalk/templates/geocamTalk/message_list.html
@@ -43,7 +43,7 @@
{% else %}
{{ m.get_author_string}}
{% endif %}
- {% if m.has_geolocation %}<a data-rel="dialog" data-transition="pop" data-inline="true" data-role="button" data-icon="geoCam-map" data-iconpos="notext">Map Info</a>{%endif%}
+ {% if m.has_geolocation %}<a href="#" data-rel="dialog" data-transition="pop" data-inline="true" data-role="button" data-icon="geoCam-map" data-iconpos="notext">Map Info</a>{%endif%}
{% if m.has_audio %}
<a class="media" href="{{m.audio_file.url}}"></a>
{%endif%}

0 comments on commit 0159e7e

Please sign in to comment.
Something went wrong with that request. Please try again.