Index: lams_central/web/includes/javascript/main.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/Attic/main.js,v
diff -u -r1.1.2.4 -r1.1.2.5
--- lams_central/web/includes/javascript/main.js 28 Oct 2016 17:05:38 -0000 1.1.2.4
+++ lams_central/web/includes/javascript/main.js 31 Oct 2016 07:35:10 -0000 1.1.2.5
@@ -458,109 +458,34 @@
function showPrivateNotificationsDialog(){
- showDialog("dialogPrivateNotifications", {
- 'height' : 470,
- 'width' : 600,
+ var notificationDialog = showDialog("dialogPrivateNotifications", {
+ 'height' : 650,
+ 'width' : 'auto',
'title' : LABELS.PRIVATE_NOTIFICATIONS_TITLE,
'close' : function(){
refreshPrivateNotificationCount();
- // completely delete the dialog
$(this).remove();
},
'open' : function() {
- // build the table from the scratch
- var dialog = $(this),
- table = $('
').appendTo(dialog),
- // table header
- headerRow = $('
').appendTo(table);
- $(' | ').text(LABELS.PRIVATE_NOTIFICATIONS_MESSAGES).appendTo(headerRow);
- // click it to mark all notifications as read
- $(' | ').text(LABELS.PRIVATE_NOTIFICATIONS_READ)
- .attr('title', LABELS.PRIVATE_NOTIFICATIONS_READ_ALL_HINT)
- .click(markAllPrivateNotificationsAsRead)
- .appendTo(headerRow);
- $('iframe', dialog).remove();
- $.ajax({
- cache : false,
- url : LAMS_URL + "notification.do",
- dataType : 'json',
- data : {
- 'method' : 'getNotificationSubscriptions',
- // maybe it will change for paging; "offset" param is also available
- 'limit' : 10
- },
- success : function(notifications) {
- if (!notifications) {
- return;
- }
-
- // build notification rows one by one
- $.each(notifications, function(){
- var notification = this,
- row = $('
').attr('id', 'subscription-' + notification.subscriptionUid)
- .appendTo(table),
- messageCell = $(' | ').appendTo(row),
- readCell = $(' | ')
- .appendTo(row);
- // is it a link?
- if (notification.message.indexOf(' td')
- // message cell
- .first().removeClass('notificationsPendingCell')
- // read cell
- .next().html('✔').removeClass('notificationsClickableCell').attr('title', null).off('click');
}
- });
+ }, false);
+
}
function refreshPrivateNotificationCount(){