aboutsummaryrefslogtreecommitdiff
path: root/views/default/js/admin.php
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/js/admin.php')
-rw-r--r--views/default/js/admin.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/views/default/js/admin.php b/views/default/js/admin.php
index afffe95f0..2f2f59287 100644
--- a/views/default/js/admin.php
+++ b/views/default/js/admin.php
@@ -5,6 +5,7 @@
* @since 1.8
*/
?>
+//<script>
elgg.provide('elgg.admin');
elgg.admin.init = function () {
@@ -45,6 +46,9 @@ elgg.admin.init = function () {
handle: 'span.elgg-state-draggable',
stop: elgg.admin.moveProfileField
});
+
+ // admin notices delete ajax
+ $('a.elgg-admin-notice').click(elgg.admin.deleteNotice);
}
/**
@@ -146,4 +150,20 @@ elgg.admin.moveProfileField = function(e, ui) {
});
}
+/**
+ * Fires the ajax action to delete the admin notice then hides the notice.
+ *
+ * @return void
+ */
+elgg.admin.deleteNotice = function(e) {
+ e.preventDefault();
+ var $container = $(this).closest('p');
+
+ elgg.action($(this).attr('href'), {
+ success: function(json) {
+ $container.slideUp('medium');
+ }
+ });
+}
+
elgg.register_hook_handler('init', 'system', elgg.admin.init, 1000); \ No newline at end of file