OSDN Git Service

t#31759:fix half helper
authoryasushiito <yas@pen-chan.jp>
Thu, 25 Jul 2013 02:49:08 +0000 (11:49 +0900)
committeryasushiito <yas@pen-chan.jp>
Thu, 25 Jul 2013 02:49:08 +0000 (11:49 +0900)
app/assets/javascripts/panels.js.coffee

index 472e438..4009bd1 100644 (file)
@@ -409,7 +409,7 @@ $ ->
     d = $(@).parent()\r
     trace = element_tag_id(d)\r
     f = $(trace + 'width')\r
-    w = f.val() / 2\r
+    w = Math.floor(f.val() / 2)\r
     f.val(w)\r
     $(trace + 'img').width(Math.abs(w))\r
     $(trace + 'img').parent().width(Math.abs(w))\r
@@ -440,7 +440,7 @@ $ ->
     d = $(@).parent()\r
     trace = element_tag_id(d)\r
     f = $(trace + 'height')\r
-    h = f.val() / 2\r
+    h = Math.floor(f.val() / 2)\r
     f.val(h)\r
     $(trace + 'img').height(Math.abs(h))\r
     $(trace + 'img').parent().height(Math.abs(h))\r