8 define(
'elgg/popup', [
'jquery',
'elgg',
'elgg/hooks',
'jquery-ui/position',
'jquery-ui/unique-id'],
function ($,
elgg, hooks) {
19 $(document).
on(
'click',
function (e) {
20 if (e.isDefaultPrevented()) {
24 var $eventTargets = $(e.target).parents().addBack();
25 if ($eventTargets.is(
'.elgg-state-popped')) {
32 popup.init =
function() {};
47 bind:
function ($triggers) {
48 $triggers.off(
'click.popup')
49 .on(
'click.popup',
function (e) {
50 if (e.isDefaultPrevented()) {
78 open:
function ($trigger,
$target, position) {
79 if (typeof $trigger ===
'undefined' || !$trigger.length) {
83 if (typeof $target ===
'undefined') {
84 var href = $trigger.attr(
'href') || $trigger.data(
'href') ||
'';
85 var targetSelector =
elgg.getSelectorFromUrlFragment(href);
86 $target = $(targetSelector);
89 var targetSelector =
'#' + $target.attr(
'id');
92 if (!$target.length) {
98 targetSelector: targetSelector,
103 position = position || {
110 $.extend(position, $trigger.data(
'position'));
112 position = hooks.trigger(
'getOptions',
'ui.popup', params, position);
122 if ($target.is(
'.elgg-state-popped')) {
123 popup.close($target);
129 $target.data(
'trigger', $trigger);
130 $target.data(
'position', position);
132 if (!$trigger.is(
'.elgg-popup-inline')) {
133 $target.appendTo(
'body');
138 $target.position(position).fadeIn()
139 .addClass(
'elgg-state-active elgg-state-popped')
142 $trigger.addClass(
'elgg-state-active');
144 $target.trigger(
'open');
154 if (typeof
$targets ===
'undefined') {
163 var $target = $(
this);
164 if (!$target.is(
':visible')) {
168 var $trigger = $target.data(
'trigger');
169 if ($trigger.length) {
170 $trigger.removeClass(
'elgg-state-active');
173 $target.fadeOut().removeClass(
'elgg-state-active elgg-state-popped');
175 $target.trigger(
'close');
180 popup.bind($(
'.elgg-popup'));
if(empty($subscriptions)) $targets
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