Elgg  Version 3.0
admin_notices.js
Go to the documentation of this file.
1 
4 define(function(require) {
5  var $ = require('jquery');
6  var Ajax = require('elgg/Ajax');
7 
8  var ajax = new Ajax();
9 
10  $(document).on('click', '.elgg-admin-notice-dismiss', function (e) {
11  e.preventDefault();
12  var $li = $(this).closest('.elgg-item-object-admin_notice');
13 
14  // slideUp allows dismissals without notices shifting around unpredictably
15  $li.slideUp(100);
16 
17  function restore() {
18  $li.show();
19  }
20 
21  ajax.action(this.href).done(function (output, statusText, jqXHR) {
22  if (jqXHR.AjaxData.status == -1) {
23  restore();
24  return;
25  }
26 
27  // When none left, remove container so it doesn't take up space. A few CSS solutions were
28  // tried, but left jerky transitions at the end of the animations.
29  if (!$('.elgg-item-object-admin_notice:visible').length) {
30  $('.elgg-admin-notices').remove();
31  }
32  }).fail(restore);
33  });
34 });
if(!$enabled) if(PHP_SAPI!== 'cli')
Interates through each element of an array and calls callback a function.
define(function(require){var $=require('jquery');var Ajax=require('elgg/Ajax');var ajax=new Ajax();$(document).on('click', '.elgg-admin-notice-dismiss', function(e){e.preventDefault();var $li=$(this).closest('.elgg-item-object-admin_notice');$li.slideUp(100);function restore(){$li.show();}ajax.action(this.href).done(function(output, statusText, jqXHR){if(jqXHR.AjaxData.status==-1){restore();return;}if(!$('.elgg-item-object-admin_notice:visible').length){$('.elgg-admin-notices').remove();}}).fail(restore);});})
Handle deleting admin notices.
elgg ajax
Wrapper function for jQuery.ajax which ensures that the url being called is relative to the elgg site...
Definition: ajax.js:19
elgg require
Throw an error if the required package isn't present.
Definition: elgglib.js:164
Bundled plugins(the contents of the"/mod"directory) are available only under the GPLv2 license.The remainder of the project is available under either MIT or GPLv2.Both licenses can be found below.More info and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two distribute and or modify the software for each author s protection and we want to make certain that everyone understands that there is no warranty for this free software If the software is modified by someone else and passed on
Definition: LICENSE.txt:96