aboutsummaryrefslogtreecommitdiff
path: root/mod/likes/views/default
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-06-25 10:43:42 -0400
committercash <cash.costello@gmail.com>2011-06-25 10:43:42 -0400
commitb60a991ae79edf3761fbf2553aae978f4e36f14c (patch)
treee04fe7d1b5864d69db6c1fbfd565fc9230684c18 /mod/likes/views/default
parent0f7ac7fc48f103955f2372abbca1743ef79809c9 (diff)
downloadelgg-b60a991ae79edf3761fbf2553aae978f4e36f14c.tar.gz
elgg-b60a991ae79edf3761fbf2553aae978f4e36f14c.tar.bz2
Fixes #3610 $guid was not defined
Diffstat (limited to 'mod/likes/views/default')
-rw-r--r--mod/likes/views/default/likes/count.php1
-rw-r--r--mod/likes/views/default/likes/js.php26
2 files changed, 27 insertions, 0 deletions
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 @@
+<?php
+/**
+ * Likes JavaScript extension for elgg.js
+ */
+?>
+
+/**
+ * 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