OSDN Git Service

t#31648:fix elm position
authoryasushiito <yas@pen-chan.jp>
Fri, 5 Jul 2013 07:58:16 +0000 (16:58 +0900)
committeryasushiito <yas@pen-chan.jp>
Fri, 5 Jul 2013 07:58:16 +0000 (16:58 +0900)
app/assets/javascripts/panels.js.coffee
app/models/panel_picture.rb

index 23154ff..38436dc 100644 (file)
@@ -97,14 +97,12 @@ $ ->
       $(@).focusout ->\r
         switch $(@).attr('column')\r
           when 'x'\r
-            trace = element_tag_id($(@)) + 'img'\r
+            trace = element_tag_id($(@)) + 'div'\r
             v = parseInt($(@).val()).toString() + 'px'\r
-            $(trace).parent().css('left', v)\r
             $(trace).css('left', v)\r
           when 'y'\r
-            trace = element_tag_id($(@)) + 'img'\r
+            trace = element_tag_id($(@)) + 'div'\r
             v = parseInt($(@).val()).toString() + 'px'\r
-            $(trace).parent().css('top', v)\r
             $(trace).css('top', v)\r
           when 'width'\r
             trace = element_tag_id($(@)) + 'img'\r
index b28a0fc..57a3a4b 100644 (file)
@@ -63,7 +63,7 @@ class PanelPicture < ActiveRecord::Base
   end
   
   def opt_div_style
-    "z-index:#{self.z}; "
+    "top:#{self.y}px; left:#{self.x}px; z-index:#{self.z}; position: absolute;"
   end
   
   def opt_img_tag spot = nil, opacity = 20
@@ -71,7 +71,7 @@ class PanelPicture < ActiveRecord::Base
     {:id => self.tag_id(:img), :panel_id => self.tag_panel_id, :element_id => self.tag_element_id, :element_type => self.tag_element_type,
     :class => "panel-picture", :vPicture => self.id, 
     :src => self.url, :width => self.width.abs, :height => self.height.abs, :picture_id => self.picture_id, :ext => self.picture.ext, :alt => self.caption, 
-    :style => "top:#{self.y}px; left:#{self.x}px; z-index:#{self.z}; #{o}"}
+    :style => "#{o}"}
   end
   
   def tmb_opt_img_tag