Elgg  Version 1.11
Functions | Variables
ui.js File Reference

Go to the source code of this file.

Functions

elgg provide ('elgg.ui')
 
elgg register_hook_handler ('init', 'system', elgg.ui.init)
 
elgg ui registerTogglableMenuItems ('add-friend', 'remove-friend')
 

Variables

elgg ui init
 
elgg ui toggles
 Toggles an element based on clicking a separate element. More...
 
elgg ui popupOpen
 Pops up an element based on clicking a separate element. More...
 
elgg ui popupClose
 Catches clicks that aren't in a popup and closes all popups. More...
 
elgg ui toggleMenu
 Toggles a child menu when the parent is clicked. More...
 
elgg ui initHoverMenu
 Initialize the hover menu. More...
 
elgg ui requiresConfirmation
 Calls a confirm() and prevents default if denied. More...
 
elgg ui loginHandler
 Repositions the login popup. More...
 
elgg ui initDatePicker
 Initialize the date picker. More...
 
elgg ui registerTogglableMenuItems
 This function registers two menu items that are actions that are the opposite of each other and ajaxifies them. More...
 
elgg ui toggleMenuItems
 
elgg ui initAccessInputs
 Initialize input/access for dynamic display of members only warning. More...
 

Function Documentation

elgg provide ( 'elgg.ui'  )
elgg register_hook_handler ( 'init ,
'system ,
elgg.ui.  init 
)
elgg ui registerTogglableMenuItems ( 'add-friend'  ,
'remove-friend'   
)

Variable Documentation

elgg ui init

Definition at line 3 of file ui.js.

elgg ui initAccessInputs

Initialize input/access for dynamic display of members only warning.

If a select.elgg-input-access is accompanied by a note (.elgg-input-access-membersonly), then hide the note when the select value is PRIVATE or group members.

Returns
void
Since
1.9.0

Definition at line 442 of file ui.js.

elgg ui initDatePicker

Initialize the date picker.

Uses the class .elgg-input-date as the selector.

If the class .elgg-input-timestamp is set on the input element, the onSelect method converts the date text to a unix timestamp in seconds. That value is stored in a hidden element indicated by the id on the input field.

Returns
void jqueryui.datepicker

Definition at line 328 of file ui.js.

elgg ui initHoverMenu

Initialize the hover menu.

Parameters
{Object}parent
Returns
void

Definition at line 196 of file ui.js.

elgg ui loginHandler
Initial value:
= function(hook, type, params, options) {
if (params.target.attr('id') == 'login-dropdown-box') {
options.my = 'right top';
options.at = 'right bottom';
return options;
}
return null;
}
list style type
Definition: admin.php:748

Repositions the login popup.

Parameters
{String}hook 'getOptions'
{String}type 'ui.popup'
{Object}params An array of info about the target and source.
{Object}options Options to pass to
Returns
{Object}

Definition at line 307 of file ui.js.

elgg ui popupClose

Catches clicks that aren't in a popup and closes all popups.

Definition at line 143 of file ui.js.

elgg ui popupOpen
elgg ui registerTogglableMenuItems

This function registers two menu items that are actions that are the opposite of each other and ajaxifies them.

E.g. like/unlike, friend/unfriend, ban/unban, etc.

Note the menu item names must be given in their normalized form. So if the name is remove_friend, you should call this function with "remove-friend" instead.

Definition at line 376 of file ui.js.

elgg ui requiresConfirmation
Initial value:
= function(e) {
var confirmText = $(this).data('confirm') || elgg.echo('question:areyousure');
if (!confirm(confirmText)) {
e.preventDefault();
}
}
elgg
Definition: install.js:23

Calls a confirm() and prevents default if denied.

Parameters
{Object}e
Returns
void

Definition at line 290 of file ui.js.

elgg ui toggleMenu
Initial value:
= function(event) {
$(this).siblings().slideToggle('medium');
$(this).toggleClass('elgg-menu-closed elgg-menu-opened');
event.preventDefault();
}

Toggles a child menu when the parent is clicked.

Parameters
{Object}event
Returns
void

Definition at line 184 of file ui.js.

elgg ui toggleMenuItems
Initial value:
= function($menu, nameOfItemToShow, nameOfItemToHide) {
$menu.find('.elgg-menu-item-' + nameOfItemToShow).removeClass('hidden').find('a').focus();
$menu.find('.elgg-menu-item-' + nameOfItemToHide).addClass('hidden');
}
$menu
Definition: default.php:19

Definition at line 428 of file ui.js.

elgg ui toggles
Initial value:
= function(event) {
event.preventDefault();
var $this = $(this),
target = $this.data().toggleSelector;
if (!target) {
target = $this.attr('href');
}
$this.toggleClass('elgg-state-active');
$(target).each(function(index, elem) {
var $elem = $(elem);
if ($elem.data().toggleSlide != false) {
$elem.slideToggle('medium');
} else {
$elem.toggle();
}
});
}
z index
Definition: admin.php:354

Toggles an element based on clicking a separate element.

Use rel="toggle" on the toggler element Set the href to target the item you want to toggle () or use data-toggle-selector="your_jquery_selector" to have an advanced selection method By default elements perform a slideToggle. If you want a normal toggle (hide/show) you can add data-toggle-slide="0" on the elements to prevent a slide. {Object} event void

Definition at line 55 of file ui.js.