aboutsummaryrefslogtreecommitdiff
path: root/views/default/js
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-17 00:24:04 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-17 00:24:04 +0000
commitfb143a5701f15a8e9792c25ec7c0a030786896d6 (patch)
treef014b07dad8e23d07959e2a25b1f19612d581d00 /views/default/js
parent3d3ecfa207a47198fca5658bb6aa6e27cb0f13da (diff)
downloadelgg-fb143a5701f15a8e9792c25ec7c0a030786896d6.tar.gz
elgg-fb143a5701f15a8e9792c25ec7c0a030786896d6.tar.bz2
Fixes #2242. Can now delete admin notices manually.
git-svn-id: http://code.elgg.org/elgg/trunk@8737 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/js')
-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