From a002e360cd8958bb31e2b6ea5b6e00c3b484022d Mon Sep 17 00:00:00 2001 From: yasushiito Date: Fri, 5 Jul 2013 16:58:16 +0900 Subject: [PATCH] t#31648:fix elm position --- app/assets/javascripts/panels.js.coffee | 6 ++---- app/models/panel_picture.rb | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/panels.js.coffee b/app/assets/javascripts/panels.js.coffee index 23154ffc..38436dcf 100644 --- a/app/assets/javascripts/panels.js.coffee +++ b/app/assets/javascripts/panels.js.coffee @@ -97,14 +97,12 @@ $ -> $(@).focusout -> switch $(@).attr('column') when 'x' - trace = element_tag_id($(@)) + 'img' + trace = element_tag_id($(@)) + 'div' v = parseInt($(@).val()).toString() + 'px' - $(trace).parent().css('left', v) $(trace).css('left', v) when 'y' - trace = element_tag_id($(@)) + 'img' + trace = element_tag_id($(@)) + 'div' v = parseInt($(@).val()).toString() + 'px' - $(trace).parent().css('top', v) $(trace).css('top', v) when 'width' trace = element_tag_id($(@)) + 'img' diff --git a/app/models/panel_picture.rb b/app/models/panel_picture.rb index b28a0fcf..57a3a4bb 100644 --- a/app/models/panel_picture.rb +++ b/app/models/panel_picture.rb @@ -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 -- 2.11.0