Elgg  Version 1.9
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
Initial value:
= function () {
$('.elgg-input-access').each(function () {
function updateMembersonlyNote() {
var val = $select.val();
if (val != acl && val !== 0) {
$note.css('visibility', 'visible');
} else {
$note.css('visibility', 'hidden');
}
}
var $select = $(this),
acl = $select.data('group-acl'),
$note = $('.elgg-input-access-membersonly', this.parentNode);
if ($note) {
updateMembersonlyNote();
$select.change(updateMembersonlyNote);
}
});
}

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 374 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 269 of file ui.js.

elgg ui initHoverMenu

Initialize the hover menu.

Parameters
{Object}parent
Returns
void

Definition at line 171 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:724

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 248 of file ui.js.

elgg ui popupClose

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

Definition at line 118 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 308 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 231 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 159 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 360 of file ui.js.

elgg ui toggles
Initial value:
= function(event) {
event.preventDefault();
var target = $(this).toggleClass('elgg-state-active').attr('href');
$(target).slideToggle('medium');
}

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 () {Object} event void

Definition at line 44 of file ui.js.