Uploaded image for project: 'PUBLIC - Liferay Social Office Community Edition'
  1. PUBLIC - Liferay Social Office Community Edition
  2. SOS-1780

Allow the notifications to be dismissed via ajax

    Details

      Description

      When a user goes to their user notifications, and they click Confirm or Ignore, it should not require an entire page refresh. What we can do is use javascript to make the request to the link, and add a wait cursor until it's finished, and then remove the row once it's done.

      I have some code that I hacked together that will get this to work:

      AUI().use('aui-base', 'aui-io-request', function(A) {
      	A.one('#_7_WAR_soportlet_notificationsMenuContent').delegate(
      		'click',
      		function(event) {
      			event.preventDefault();
      
      			var row = event.currentTarget.ancestor('.user-notification-event-content');
      			var loadingRow = A.Node.create('<div class="loading-animation"></div>');
      
      			row.hide().placeAfter(loadingRow);
      
      			A.io.request(
      				event.currentTarget.attr('href'), 
      				{
      					on: {
      						success: function() {
      							row.remove();
      							loadingRow.remove();
      						}
      					}
      				}
      			);
      		},
      		'a'
      	);
      });
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  5 years, 19 weeks, 1 day ago

                  Packages

                  Version Package
                  3.X EE
                  3.X CE
                  3.1 EE