Changeset 14259ce in github
- Timestamp:
- May 25, 2010 4:42:39 AM (3 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- 1a4fa6f
- Parents:
- 3831efb
- File:
-
- 1 edited
-
program/js/app.js (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
program/js/app.js
r3831efb r14259ce 200 200 this.set_alttext('delete', 'movemessagetotrash'); 201 201 202 this.env.message_commands = ['show', 'reply', 'reply-all', 'forward', 'moveto', 'copy', 'delete', 203 'open', 'mark', 'edit', 'viewsource', 'download', 'print', 'load-attachment', 'load-headers']; 204 202 205 if (this.env.action=='show' || this.env.action=='preview') { 203 this.enable_command('show', 'reply', 'reply-all', 'forward', 'moveto', 'copy', 'delete', 204 'open', 'mark', 'edit', 'viewsource', 'download', 'print', 'load-attachment', 'load-headers', true); 206 this.enable_command(this.env.message_commands, true); 205 207 206 208 if (this.env.next_uid) { … … 1048 1050 }; 1049 1051 1050 // set command enabled or disabled1052 // set command(s) enabled or disabled 1051 1053 this.enable_command = function() 1052 1054 { 1053 var args = arguments, len = args.length; 1054 if (!len) 1055 return -1; 1056 1057 var command, enable = args[len-1]; 1055 var args = arguments, len = args.length, 1056 command, enable = args[len-1]; 1058 1057 1059 1058 for (var n=0, len=len-1; n<len; n++) { 1059 if (typeof args[n] === 'object') { 1060 for (var i in args[n]) 1061 this.enable_command(args[n][i], enable); 1062 continue; 1063 } 1060 1064 command = args[n]; 1061 1065 this.commands[command] = enable; 1062 1066 this.set_button(command, (enable ? 'act' : 'pas')); 1063 1067 } 1064 return true;1065 1068 }; 1066 1069 … … 1399 1402 var selected = list.get_single_selection() != null; 1400 1403 1404 this.enable_command(this.env.message_commands, selected); 1401 1405 // Hide certain command buttons when Drafts folder is selected 1402 this.enable_command('reply', 'reply-all', 'forward', this.env.mailbox == this.env.drafts_mailbox ? false : selected); 1403 this.enable_command('show', 'print', 'open', 'edit', 'download', 'viewsource', selected); 1406 if (selected && this.env.mailbox == this.env.drafts_mailbox) { 1407 this.enable_command('reply', 'reply-all', 'forward', false); 1408 } 1409 // Multi-message commands 1404 1410 this.enable_command('delete', 'moveto', 'copy', 'mark', (list.selection.length > 0 ? true : false)); 1405 1411 … … 2326 2332 2327 2333 // Hide message command buttons until a message is selected 2328 this.enable_command( 'reply', 'reply-all', 'forward', 'delete', 'mark', 'print', 'open', 'edit', 'viewsource', 'download', false);2334 this.enable_command(this.env.message_commands, false); 2329 2335 2330 2336 this._with_selected_messages('moveto', lock, add_url); … … 4931 4937 for (var i=0; i < response.callbacks.length; i++) 4932 4938 this.triggerEvent(response.callbacks[i][0], response.callbacks[i][1]); 4939 } 4933 4940 4934 4941 // process the response data according to the sent action … … 4945 4952 if (this.env.action == 'show') { 4946 4953 // re-enable commands on move/delete error 4947 this.enable_command( 'reply', 'reply-all', 'forward', 'delete', 'mark', 'print', 'open', 'edit', 'viewsource', 'download', true);4954 this.enable_command(this.env.message_commands, true); 4948 4955 } 4949 4956 break; … … 4956 4963 this.show_contentframe(false); 4957 4964 // disable commands useless when mailbox is empty 4958 this.enable_command('show', 'reply', 'reply-all', 'forward', 'moveto', 'copy', 'delete', 4959 'mark', 'viewsource', 'open', 'edit', 'download', 'print', 'load-attachment', 4965 this.enable_command(this.env.message_commands, 4960 4966 'purge', 'expunge', 'select-all', 'select-none', 'sort', 4961 4967 'expand-all', 'expand-unread', 'collapse-all', false);
Note: See TracChangeset
for help on using the changeset viewer.
