From b60a991ae79edf3761fbf2553aae978f4e36f14c Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 25 Jun 2011 10:43:42 -0400 Subject: Fixes #3610 $guid was not defined --- js/lib/ui.js | 20 -------------------- mod/likes/start.php | 1 + mod/likes/views/default/likes/count.php | 1 + mod/likes/views/default/likes/js.php | 26 ++++++++++++++++++++++++++ 4 files changed, 28 insertions(+), 20 deletions(-) create mode 100644 mod/likes/views/default/likes/js.php diff --git a/js/lib/ui.js b/js/lib/ui.js index 692311d73..89a996122 100644 --- a/js/lib/ui.js +++ b/js/lib/ui.js @@ -227,25 +227,6 @@ elgg.ui.requiresConfirmation = function(e) { } }; -/** - * Repositions the likes popup - * - * @param {String} hook 'getOptions' - * @param {String} type 'ui.popup' - * @param {Object} params An array of info about the target and source. - * @param {Object} options Options to pass to - * - * @return {Object} - */ -elgg.ui.likesPopupHandler = function(hook, type, params, options) { - if (params.target.hasClass('elgg-likes-list')) { - options.my = 'right bottom'; - options.at = 'left top'; - return options; - } - return null; -}; - /** * Repositions the login popup * @@ -266,5 +247,4 @@ elgg.ui.LoginHandler = function(hook, type, params, options) { }; elgg.register_hook_handler('init', 'system', elgg.ui.init); -elgg.register_hook_handler('getOptions', 'ui.popup', elgg.ui.likesPopupHandler); elgg.register_hook_handler('getOptions', 'ui.popup', elgg.ui.LoginHandler); \ No newline at end of file diff --git a/mod/likes/start.php b/mod/likes/start.php index df1c7b109..d45fb96b3 100644 --- a/mod/likes/start.php +++ b/mod/likes/start.php @@ -9,6 +9,7 @@ elgg_register_event_handler('init', 'system', 'likes_init'); function likes_init() { elgg_extend_view('css/elgg', 'likes/css'); + elgg_extend_view('js/elgg', 'likes/js'); // registered with priority < 500 so other plugins can remove likes elgg_register_plugin_hook_handler('register', 'menu:river', 'likes_river_menu_setup', 400); diff --git a/mod/likes/views/default/likes/count.php b/mod/likes/views/default/likes/count.php index 3d03fec66..bdc50bcd1 100644 --- a/mod/likes/views/default/likes/count.php +++ b/mod/likes/views/default/likes/count.php @@ -8,6 +8,7 @@ $list = ''; $num_of_likes = likes_count($vars['entity']); +$guid = $vars['entity']->getGUID(); if ($num_of_likes) { // display the number of likes diff --git a/mod/likes/views/default/likes/js.php b/mod/likes/views/default/likes/js.php new file mode 100644 index 000000000..b7e000539 --- /dev/null +++ b/mod/likes/views/default/likes/js.php @@ -0,0 +1,26 @@ + + +/** + * Repositions the likes popup + * + * @param {String} hook 'getOptions' + * @param {String} type 'ui.popup' + * @param {Object} params An array of info about the target and source. + * @param {Object} options Options to pass to + * + * @return {Object} + */ +elgg.ui.likesPopupHandler = function(hook, type, params, options) { + if (params.target.hasClass('elgg-likes-list')) { + options.my = 'right bottom'; + options.at = 'left top'; + return options; + } + return null; +}; + +elgg.register_hook_handler('getOptions', 'ui.popup', elgg.ui.likesPopupHandler); \ No newline at end of file -- cgit v1.2.3