2017 © Pedro Peláez
 

elgg-plugin ui_popup

Popup AMD module for Elgg

image

hypejunction/ui_popup

Popup AMD module for Elgg

  • Wednesday, April 6, 2016
  • by hypeJunction
  • Repository
  • 1 Watchers
  • 0 Stars
  • 44 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Popups for Elgg

Elgg 2.0, (*1)

Features

  • Coverts popups into an AMD module
  • Allows to programmically open and close popups
  • Allows passing popup position via data- parameters of the trigger

Usage

Bind by href attribute

This behaviour is identical to adding rel="popup" to your anchor element., (*2)

echo elgg_view('output/url', array(
    'class' => 'popup-trigger',
    'href' => '#popup',
));
define(function(require) {
    var $ = require('jquery');
    var popup = require('elgg/popup');
    popup.bind($('.popup-trigger'));
});

Custom elements

echo elgg_format_element('button', [
    'class' => 'elgg-button elgg-button-popup',
    'data-my' => 'center top',
    'data-at' => 'center bottom+10px',
], 'Open Popup');
echo elgg_format_element('div', [
    'class' => 'elgg-module elgg-module-popup hidden',
], 'My popup');
define(function(require) {
    var $ = require('jquery');
    $(document).on('click', '.elgg-button-popup', function(e) {
        e.preventDefault();
        var $trigger = $(this);
        var $target = $(this).next('.elgg-module-popup');
        if ($target.length) {
            require(['elgg/popup'], function(popup) {
                popup.open($trigger, $target, {
                    'collision': 'fit none'
                });
            });
        }
    });
});

The Versions

06/04 2016

dev-master

9999999-dev http://hypejunction.com

Popup AMD module for Elgg

  Sources   Download

GPL-2.0

The Requires

 

by Ismayil Khayredinov

plugin ui popup elgg

06/04 2016

1.1.0

1.1.0.0 http://hypejunction.com

Popup AMD module for Elgg

  Sources   Download

GPL-2.0

The Requires

 

by Ismayil Khayredinov

plugin ui popup elgg

27/01 2016

1.0.0

1.0.0.0 http://hypejunction.com

Popup AMD module for Elgg

  Sources   Download

GPL-2.0

The Requires

 

by Ismayil Khayredinov

plugin ui popup elgg