From 141cd657f2d6a583113b84978215f29ad97bb70d Mon Sep 17 00:00:00 2001 From: jordan Date: Wed, 9 May 2012 20:59:46 +0000 Subject: [PATCH] try to get the position of the event currentTarget if there is no pageX or pageY property, useful when dealing with popups called by keyup event git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1261 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- forum/models/action.py | 4 ++ forum/skins/default/media/js/osqa.main.js | 9 +++- .../default/templates/node/award_points.html | 22 +++++---- osqa.iml | 46 +++++++++++-------- 4 files changed, 52 insertions(+), 29 deletions(-) diff --git a/forum/models/action.py b/forum/models/action.py index 7e88745..55cf733 100644 --- a/forum/models/action.py +++ b/forum/models/action.py @@ -135,7 +135,11 @@ class Action(BaseModel): if isnew: if (self.node is None) or (not self.node.nis.wiki): self.repute_users() + + if isnew: self.process_action() + + if isnew: self.trigger_hooks(threaded, True) return self diff --git a/forum/skins/default/media/js/osqa.main.js b/forum/skins/default/media/js/osqa.main.js index 0122c25..2cae49e 100644 --- a/forum/skins/default/media/js/osqa.main.js +++ b/forum/skins/default/media/js/osqa.main.js @@ -197,8 +197,15 @@ function show_dialog (extern) { copy_id = ' id="copy_clip_button"' } - if (options.event != undefined) { + if (options.event != undefined && options.event.pageX != undefined && options.event.pageY != undefined) { options.pos = {x: options.event.pageX, y: options.event.pageY}; + } else if (options.event.currentTarget != undefined) { + var el = jQuery("#" + options.event.currentTarget.id); + var position = el.offset(); + options.pos = { + x: position.left, + y: position.top + } } var html = '