comparison gpp/messages/static/js/tabbed_messages.js @ 481:9f888dbe61ce

Fixing #230; add a scrollbar to the PM popup dialog if necessary. This wasn't as easy as I thought. Had to wrap the PM text in a div with its styling (max-height and overflow). If I then resized the dialog, I'd get two scrollbars. So for now, made the dialog non-resizable.
author Brian Neal <bgneal@gmail.com>
date Fri, 07 Oct 2011 02:11:33 +0000
parents 9df368d9775d
children
comparison
equal deleted inserted replaced
480:1a7ca5fa494f 481:9f888dbe61ce
30 } 30 }
31 }); 31 });
32 $msgDialog = $('#msgDialog').dialog({ 32 $msgDialog = $('#msgDialog').dialog({
33 autoOpen: false, 33 autoOpen: false,
34 width: 460, 34 width: 460,
35 height: 'auto',
36 maxHeight: false,
37 resizable: false,
35 buttons: [ 38 buttons: [
36 { 39 {
37 text: "Reply", 40 text: "Reply",
38 click: function() { 41 click: function() {
39 doReply = true; 42 doReply = true;
87 { 90 {
88 updateUnreadMsgText(--unreadMsgCount); 91 updateUnreadMsgText(--unreadMsgCount);
89 } 92 }
90 } 93 }
91 94
92 $msgDialog.html(msg.content); 95 var s = '<div style="max-height:450px;overflow:auto">' + msg.content + '</div>';
96 $msgDialog.html(s);
93 var title = 'PM From ' + msg.sender + ' To ' + msg.receiver + '<br /> ' + msg.subject; 97 var title = 'PM From ' + msg.sender + ' To ' + msg.receiver + '<br /> ' + msg.subject;
94 $msgDialog.dialog('option', 'title', title); 98 $msgDialog.dialog('option', 'title', title);
95 $msgDialog.dialog('open'); 99 $msgDialog.dialog('open');
96 } 100 }
97 101