]> git.openstreetmap.org Git - osqa.git/commitdiff
try to get the position of the event currentTarget if there is no pageX or pageY...
authorjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Wed, 9 May 2012 20:59:46 +0000 (20:59 +0000)
committerjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Wed, 9 May 2012 20:59:46 +0000 (20:59 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1261 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/models/action.py
forum/skins/default/media/js/osqa.main.js
forum/skins/default/templates/node/award_points.html
osqa.iml

index 7e887452dcd0451909cc618f834179ade80fd2a4..55cf733886bf37479df94f727b8fd2c6bb98cf24 100644 (file)
@@ -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
index 0122c2576910865bfff2e7529358c252819d500d..2cae49e8f7ce9c6cde45960692ba267fd96c2291 100644 (file)
@@ -197,8 +197,15 @@ function show_dialog (extern) {
         copy_id = ' id="copy_clip_button"'\r
     }\r
 \r
-    if (options.event != undefined) {\r
+    if (options.event != undefined && options.event.pageX != undefined && options.event.pageY != undefined) {\r
         options.pos = {x: options.event.pageX, y: options.event.pageY};\r
+    } else if (options.event.currentTarget != undefined) {\r
+        var el = jQuery("#" + options.event.currentTarget.id);\r
+        var position = el.offset();\r
+        options.pos = {\r
+            x: position.left,\r
+            y: position.top\r
+        }\r
     }\r
 \r
     var html = '<div class="dialog ' + options.extra_class + '" style="display: none; z-index: 999;">'\r
index ccf1028177c5817700bee1cee8047a5b127e75ef..3b60e8f9aa523d4af81f9010a6d567a1d711ec58 100644 (file)
@@ -41,7 +41,7 @@
                 show_no: true,
                 no_callback: function() {
                     $(".dialog").fadeOut("fast", function() {
-                    $('.dialog').remove();
+                        $('.dialog').remove();
                     })
                 },
 
 
     $('.award_points_slider').slider({
         min: 1, max: user_reputation,
-    slide: function(evt, ui) {
-        $('#points_input').val(ui.value);
-        points_award_confirm(Number(ui.value), evt)
-    }
+        slide: function(evt, ui) {
+            $('#points_input').val(ui.value);
+            points_award_confirm(Number(ui.value), evt)
+        }
     });
 
-    $('#points_input').bind('change keydown', function(evt) {
+    $('#points_input').live('change keyup', function(evt) {
         if ($(this).val() > user_reputation) {
-        $(this).attr('value', user_reputation);
-    }
-    $('.award_points_slider').slider('option', 'value', $(this).val())
+            $(this).attr('value', user_reputation);
+        }
+
+        points_award_confirm(Number($(this).val()), evt);
+
+        $('.award_points_slider').slider('option', 'value', $(this).val());
 
-    points_award_confirm(Number($(this).val()), evt);
     });
 
 </script>
\ No newline at end of file
index ff76cadacc96367efa763ae07f21721ae9e822e1..0fd71e34b29f9a5ff4da870c85ed92e493907fef 100644 (file)
--- a/osqa.iml
+++ b/osqa.iml
@@ -1,18 +1,28 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<module type="PYTHON_MODULE" version="4">\r
-  <component name="FacetManager">\r
-    <facet type="django" name="Django">\r
-      <configuration>\r
-        <option name="rootFolder" value="$MODULE_DIR$" />\r
-        <option name="settingsModule" value="settings.py" />\r
-        <option name="manageScript" value="manage.py" />\r
-      </configuration>\r
-    </facet>\r
-  </component>\r
-  <component name="NewModuleRootManager" inherit-compiler-output="false">\r
-    <content url="file://$MODULE_DIR$" />\r
-    <orderEntry type="inheritedJdk" />\r
-    <orderEntry type="sourceFolder" forTests="false" />\r
-  </component>\r
-</module>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="PYTHON_MODULE" version="4">
+  <component name="FacetManager">
+    <facet type="django" name="Django">
+      <configuration>
+        <option name="rootFolder" value="$MODULE_DIR$" />
+        <option name="settingsModule" value="settings.py" />
+        <option name="manageScript" value="manage.py" />
+      </configuration>
+    </facet>
+  </component>
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="jdk" jdkName="Python 2.7.1 (/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7)" jdkType="Python SDK" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+  <component name="TemplatesService">
+    <option name="templateLanguage" value="Django" />
+    <option name="TEMPLATE_CONFIGURATION" value="Django" />
+    <option name="TEMPLATE_FOLDERS">
+      <list>
+        <option value="$MODULE_DIR$/templates" />
+      </list>
+    </option>
+  </component>
+</module>
+