- Timestamp:
- 06/19/12 23:40:56 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/expressoServiceImap/prototype/modules/attach_message/common.js
r6510 r6545 4 4 months = ['Jan','Feb','Mar','Apr','May','June','July','Aug','Sept','Oct','Nov','Dec']; 5 5 current_folder = 'INBOX'; 6 current_count = DataLayer.get( 'message', { criteria: { count: true, properties: {context:{folder:current_folder}} } }, true ); 6 7 7 8 DataLayer.codec( 'folder', 'tree', { … … 56 57 57 58 encoder: function( data, crit ){ 58 59 if( !crit.criteria.properties.context.folder.indexOf( 'local_messages/' ) ) 59 60 crit = crit.criteria; 61 62 if( !crit.properties.context.folder.indexOf( 'local_messages/' ) ) 60 63 { 61 var msgs = expresso_local_messages.get_local_range_msgs( crit. criteria.properties.context.folder.replace(dots, "/").replace("local_messages/", ""),64 var msgs = expresso_local_messages.get_local_range_msgs( crit.properties.context.folder.replace(dots, "/").replace("local_messages/", ""), 62 65 crit.offset + 1, crit.limit, "SORTARRIVAL", crit.orderDesc, "ALL", 1, 1 ); 63 66 … … 75 78 } 76 79 77 return( {"rows": msgs, 78 "records": msgs.length, 79 "page": crit.page, 80 "total": Math.ceil( msgs.num_msgs / crit.limit )} ); 80 data = msgs; 81 81 } 82 82 83 return( data ); 83 return( {"rows": data, 84 "records": data.num_msgs || current_count, 85 "page": crit.offset / crit.limit + 1, 86 "total": Math.ceil( data.num_msgs || current_count / crit.limit )} ); 84 87 }, 85 88 criteria: function( crit ){ 86 89 87 return { criteria: { properties: {context:{folder: current_folder || 'INBOX'}}, offset: crit.rows * ( crit.page - 1 ), limit: crit.rows, orderDesc: crit.sord == "desc" } };90 return { criteria: { properties: {context:{folder: current_folder || 'INBOX'}}, offset: crit.rows * ( crit.page - 1 ), limit: crit.rows, orderDesc: crit.sord == "desc", currentCount: current_count } }; 88 91 89 92 }
Note: See TracChangeset
for help on using the changeset viewer.