Browse files

Closes #12 (Show loading message on Lists view).

  • Loading branch information...
1 parent 253dd73 commit fcefa01a3eb6a4d6ce0628b732eb9c665b78e0d6 @yllus committed Mar 1, 2012
Showing with 9 additions and 0 deletions.
  1. +4 −0 js/global.js
  2. +4 −0 js/list.js
  3. +1 −0 screens/lists.html
View
4 js/global.js
@@ -73,6 +73,7 @@ var CONST_MENTIONS = 6;
var CONST_DIRECTMESSAGES = 7;
var CONST_ACTION_READY = 0;
var CONST_ACTION_LOADING = 1;
+var CONST_ACTION_BLANK = 2;
// The "traffic cop" function controlling what JS gets executed when a screen has loaded (but is not yet
// displayed), so refer to element.
@@ -236,6 +237,9 @@ function display_action_message( num_action, element ) {
case CONST_ACTION_READY:
str_action = 'Touch to refresh';
break;
+ case CONST_ACTION_BLANK:
+ str_action = '';
+ break;
}
if ( document.getElementById('div_titleaction') !== null ) {
View
4 js/list.js
@@ -89,12 +89,16 @@ function List( u, s ) {
// View a specific list's timeline.
this.view_list = function( id_str, name, go_back ) {
+ display_action_message(CONST_ACTION_LOADING);
+
oauth.get('https://api.twitter.com/1/lists/statuses.json?include_rts=true&per_page=' + status_count + '&list_id=' + id_str,
function(data) {
var json_data = JSON.parse(data.text);
lists.set_position(id_str);
+ display_action_message(CONST_ACTION_LOADING);
+
if ( go_back == 1 ) {
set_last_action("lists.view_list('" + id_str + "', '" + name + "', 1);");
View
1 screens/lists.html
@@ -3,6 +3,7 @@
<script type="text/javascript" src="js/screens/lists.js"></script>
<div class="titlebar">
<div id="div_titlename" style="float: left;">Lists</div>
+ <div id="div_titleaction" style="padding-right: 10px; float: right;"></div>
</div>
<div id="div_lists" data-bb-type="text-arrow-list" style="top: 33px; height: 503px; width: 1024px; position: absolute; overflow: auto; display: none;">></div>
<div class="toolbar" style="padding: 0; height: 64px;">

0 comments on commit fcefa01

Please sign in to comment.