8 define(
'elgg/popup', [
'elgg',
'jquery',
'jquery-ui'],
function (
elgg, $) {
20 $(document).
on(
'click',
function (e) {
21 if (e.isDefaultPrevented()) {
24 var $eventTargets = $(e.target).parents().andSelf();
25 if ($eventTargets.is(
'.elgg-state-popped')) {
31 popup.init =
elgg.nullFunction;
45 bind:
function ($triggers) {
46 $triggers.off(
'click.popup')
47 .on(
'click.popup',
function (e) {
48 if (e.isDefaultPrevented()) {
74 open:
function ($trigger,
$target, position) {
75 if (typeof $trigger ===
'undefined' || !$trigger.length) {
79 if (typeof $target ===
'undefined') {
80 var href = $trigger.attr(
'href') || $trigger.data(
'href') ||
'';
81 var targetSelector =
elgg.getSelectorFromUrlFragment(href);
82 $target = $(targetSelector);
85 var targetSelector =
'#' + $target.attr(
'id');
88 if (!$target.length) {
94 targetSelector: targetSelector,
99 position = position || {
106 $.extend(position, $trigger.data(
'position'));
108 position =
elgg.trigger_hook(
'getOptions',
'ui.popup', params, position);
118 if ($target.is(
'.elgg-state-popped')) {
119 popup.close($target);
125 $target.data(
'trigger', $trigger);
126 $target.data(
'position', position);
128 if (!$trigger.is(
'.elgg-popup-inline')) {
129 $target.appendTo(
'body');
132 $(document).one(
'scroll',
function() {
139 $target.position(position).fadeIn()
140 .addClass(
'elgg-state-active elgg-state-popped')
143 $trigger.addClass(
'elgg-state-active');
145 $target.trigger(
'open');
153 close:
function ($targets) {
154 if (typeof $targets ===
'undefined') {
155 $targets = $(
'.elgg-state-popped');
157 if (!$targets.length) {
160 $targets.each(
function () {
161 var $target = $(
this);
162 if (!$target.is(
':visible')) {
166 var $trigger = $target.data(
'trigger');
167 if ($trigger.length) {
168 $trigger.removeClass(
'elgg-state-active');
172 $target.fadeOut().removeClass(
'elgg-state-active elgg-state-popped');
174 $target.trigger(
'close');
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