Skip to content

Commit

Permalink
Dev: Add link to remove all notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Aug 3, 2016
1 parent 0ffa419 commit 095917a
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 deletions.
8 changes: 7 additions & 1 deletion application/views/admin/super/admin_notifications.php
Expand Up @@ -61,7 +61,13 @@ class='admin-notification-link'
<li class="divider"></li>

<li id='notification-clear-all'>
<a onclick='' href='<?php echo $clearAllNotificationsUrl; ?>'><span class='fa fa-trash text-warning'></span>&nbsp;<?php eT('Delete all notifications'); ?></a>
<a
onclick='LS.deleteAllNotifications("<?php echo $clearAllNotificationsUrl; ?>", "<?php echo Notification::getUpdateUrl($surveyId); ?>");'
href='#'
>
<span class='fa fa-trash text-warning'></span>&nbsp;
<?php eT('Delete all notifications'); ?>
</a>
</li>
</ul>

Expand Down
26 changes: 22 additions & 4 deletions scripts/admin/notifications.js
Expand Up @@ -135,10 +135,10 @@ $(document).ready(function() {
function styleNotificationMenu(that)
{
var height = window.innerHeight - 100;
$(that).find('#notification-outer-ul').css('height', '400px');
$(that).find('#notification-outer-ul').css('width', '350px');
$(that).find('#notification-inner-ul').css('height', '340px');
$(that).find('#notification-inner-ul').css('width', '340px');
//$(that).find('#notification-outer-ul').css('height', '400px');
//$(that).find('#notification-outer-ul').css('width', '350px');
//$(that).find('#notification-inner-ul').css('height', '340px');
//$(that).find('#notification-inner-ul').css('width', '340px');
//$(that).find('.dropdown-menu').css('overflow-y', 'scroll');

//$('#notification-clear-all').css('top', (height + 50) + 'px');
Expand All @@ -148,6 +148,24 @@ $(document).ready(function() {
}
LS.styleNotificationMenu = styleNotificationMenu;

/**
* Called when user clicks "Delete all notifications"
* @param {string} url
* @return
*/
function deleteAllNotifications(url, updateUrl) {
$.ajax({
url: url,
method: 'GET',
success: function (response) {
console.log('response', response);
}
}).then(function() {
updateNotificationWidget(updateUrl);
});;
}
LS.deleteAllNotifications = deleteAllNotifications;

initNotification();

});
9 changes: 8 additions & 1 deletion styles/Sea_Green/css/lime-admin-common.css
Expand Up @@ -2052,7 +2052,6 @@ table#responsedetail tr td{
border-radius: 4px;
background-clip: padding-box;
overflow-y: scroll;
margin-bottom: 10px;
}

.notification-list > li > a {
Expand Down Expand Up @@ -2085,3 +2084,11 @@ table#responsedetail tr td{
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
cursor: not-allowed;
}
#notification-outer-ul {
height: 400px;
width: 350px;
}
#notification-inner-ul {
height: 340px;
width: 340px;
}

0 comments on commit 095917a

Please sign in to comment.