]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #3278 Login popup aligned to right side of button.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 7 Apr 2011 02:08:17 +0000 (02:08 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 7 Apr 2011 02:08:17 +0000 (02:08 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@8948 36083f99-b078-4883-b0ff-0f9b5a30f544

js/lib/ui.js

index 0e6634020613185f56663590597c1292118c7c90..c988b859064893791882474f9ccd93b4f59d05f5 100644 (file)
@@ -245,5 +245,25 @@ elgg.ui.likesPopupHandler = function(hook, type, params, options) {
        return null;
 };
 
+/**
+ * Repositions the login 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.likesLoginHandler = 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;
+};
+
 elgg.register_hook_handler('init', 'system', elgg.ui.init);
-elgg.register_hook_handler('getOptions', 'ui.popup', elgg.ui.likesPopupHandler);
\ No newline at end of file
+elgg.register_hook_handler('getOptions', 'ui.popup', elgg.ui.likesPopupHandler);
+elgg.register_hook_handler('getOptions', 'ui.popup', elgg.ui.likesLoginHandler);
\ No newline at end of file