aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-20 21:48:41 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-20 21:48:41 +0000
commitee8c54c3f564288798c6baec26b2b4e0ff327f78 (patch)
tree648a611af698071c86ec17e26257c25f362d3055 /js
parente2ee7b52deb8bbe99a8f0bc9b74bd684ac9aa37b (diff)
downloadelgg-ee8c54c3f564288798c6baec26b2b4e0ff327f78.tar.gz
elgg-ee8c54c3f564288798c6baec26b2b4e0ff327f78.tar.bz2
Fixes #3094. Removed event blocking code for popups.
git-svn-id: http://code.elgg.org/elgg/trunk@8790 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'js')
-rw-r--r--js/lib/ui.js34
1 files changed, 6 insertions, 28 deletions
diff --git a/js/lib/ui.js b/js/lib/ui.js
index 5451dce73..030390823 100644
--- a/js/lib/ui.js
+++ b/js/lib/ui.js
@@ -106,41 +106,19 @@ elgg.ui.popsUp = function(event) {
* Catches clicks that aren't in a popup and closes all popups.
*/
elgg.ui.popupClose = function(event) {
- event.preventDefault();
- event.stopPropagation();
-
$eventTarget = $(event.target);
- var inTarget = false;
var $popups = $('[rel=popup]');
- // if the click event target isn't in a popup target, fade all of them out.
$popups.each(function(i, e) {
- var target = elgg.getUrlFragment($(e).attr('href')) + ':visible';
- var $target = $(target);
-
- if (!$target.is(':visible')) {
- return;
- }
-
- // didn't click inside the target
- if ($eventTarget.closest(target).length > 0) {
- inTarget = true;
- return false;
+ var $e = $(e);
+ var $target = $(elgg.getUrlFragment($e.attr('href')) + ':visible');
+ if ($target.length > 0) {
+ $target.fadeOut();
+ $e.removeClass('elgg-state-active');
}
});
- if (!inTarget) {
- $popups.each(function(i, e) {
- var $e = $(e);
- var $target = $(elgg.getUrlFragment($e.attr('href')) + ':visible');
- if ($target.length > 0) {
- $target.fadeOut();
- $e.removeClass('elgg-state-active');
- }
- });
-
- $('body').die('click', elgg.ui.popClose);
- }
+ $('body').die('click', elgg.ui.popClose);
}
/**