From 048969a77c32190e9590115b67a525d61f4752c6 Mon Sep 17 00:00:00 2001 From: brettp Date: Tue, 4 Jan 2011 19:48:31 +0000 Subject: Refs #2771: Removing CRLFs from javascript files. git-svn-id: http://code.elgg.org/elgg/trunk@7826 36083f99-b078-4883-b0ff-0f9b5a30f544 --- js/lib/ui.js | 156 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 78 insertions(+), 78 deletions(-) (limited to 'js/lib/ui.js') diff --git a/js/lib/ui.js b/js/lib/ui.js index a1d852e5a..56f2d5eb0 100644 --- a/js/lib/ui.js +++ b/js/lib/ui.js @@ -1,79 +1,79 @@ -elgg.provide('elgg.ui'); - -elgg.ui.init = function () { - //if the user clicks a system message, make it disappear - $('.elgg-system-messages li').live('click', function() { - $(this).stop().fadeOut('fast'); - }); - - $('.elgg-toggle').live('click', elgg.ui.toggle); - - $('.elgg-menu-parent').live('click', elgg.ui.toggleMenu); - - $('.elgg-like-toggle').live('click', elgg.ui.toggleLikes); - - $('a.collapsibleboxlink').click(elgg.ui.toggleCollapsibleBox); -}; - -/** - * Toggles an element based on clicking a separate element - * - * Use .elgg-toggle on the toggler element - * The id of the toggler is elgg-toggler- - * The id of the element being toggled is elgg-togglee- - * - * @param {Object} event - * @return void - */ -elgg.ui.toggle = function(event) { - var id = $(this).attr('id').replace('toggler', 'togglee'); - $('#' + id).slideToggle('medium'); - event.preventDefault(); -} - -/** - * Toggles a child menu when the parent is clicked - * - * @param {Object} event - * @return void - */ -elgg.ui.toggleMenu = function(event) { - $(this).siblings().slideToggle('medium'); - $(this).toggleClass('elgg-menu-closed elgg-menu-opened'); - event.preventDefault(); -} - -// reusable generic hidden panel -elgg.ui.toggleCollapsibleBox = function () { - //$(this.parentNode.parentNode).children(".collapsible_box").slideToggle("fast"); - return false; -}; - -/** - * Toggles the likes list - * - * @param {Object} event - * @return void - */ -elgg.ui.toggleLikes = function(event) { - var $list = $(this).next(".elgg-likes-list"); - var position = $(this).position(); - var startTop = position.top; - var stopTop = position.top - $list.height(); - if ($list.css('display') == 'none') { - $('.elgg-likes-list').fadeOut(); - - $list.css('top', startTop); - $list.css('left', position.left - $list.width()); - $list.animate({opacity: "toggle", top: stopTop}, 500); - - $list.click(function(event) { - $list.fadeOut(); - }); - } else { - $list.animate({opacity: "toggle", top: startTop}, 500); - } - event.preventDefault(); -} - +elgg.provide('elgg.ui'); + +elgg.ui.init = function () { + //if the user clicks a system message, make it disappear + $('.elgg-system-messages li').live('click', function() { + $(this).stop().fadeOut('fast'); + }); + + $('.elgg-toggle').live('click', elgg.ui.toggle); + + $('.elgg-menu-parent').live('click', elgg.ui.toggleMenu); + + $('.elgg-like-toggle').live('click', elgg.ui.toggleLikes); + + $('a.collapsibleboxlink').click(elgg.ui.toggleCollapsibleBox); +}; + +/** + * Toggles an element based on clicking a separate element + * + * Use .elgg-toggle on the toggler element + * The id of the toggler is elgg-toggler- + * The id of the element being toggled is elgg-togglee- + * + * @param {Object} event + * @return void + */ +elgg.ui.toggle = function(event) { + var id = $(this).attr('id').replace('toggler', 'togglee'); + $('#' + id).slideToggle('medium'); + event.preventDefault(); +} + +/** + * Toggles a child menu when the parent is clicked + * + * @param {Object} event + * @return void + */ +elgg.ui.toggleMenu = function(event) { + $(this).siblings().slideToggle('medium'); + $(this).toggleClass('elgg-menu-closed elgg-menu-opened'); + event.preventDefault(); +} + +// reusable generic hidden panel +elgg.ui.toggleCollapsibleBox = function () { + //$(this.parentNode.parentNode).children(".collapsible_box").slideToggle("fast"); + return false; +}; + +/** + * Toggles the likes list + * + * @param {Object} event + * @return void + */ +elgg.ui.toggleLikes = function(event) { + var $list = $(this).next(".elgg-likes-list"); + var position = $(this).position(); + var startTop = position.top; + var stopTop = position.top - $list.height(); + if ($list.css('display') == 'none') { + $('.elgg-likes-list').fadeOut(); + + $list.css('top', startTop); + $list.css('left', position.left - $list.width()); + $list.animate({opacity: "toggle", top: stopTop}, 500); + + $list.click(function(event) { + $list.fadeOut(); + }); + } else { + $list.animate({opacity: "toggle", top: startTop}, 500); + } + event.preventDefault(); +} + elgg.register_event_handler('init', 'system', elgg.ui.init); \ No newline at end of file -- cgit v1.2.3