g
This commit is contained in:
@@ -15,12 +15,13 @@ App.SectionTableView = Ember.View.extend DragNDrop.Draggable,
|
||||
).property('content.id')
|
||||
offsetX: (->
|
||||
return 0 unless section_width = @get('content.section.width')
|
||||
(@content.get('position_x') || 0) * @containerWidth() / section_width
|
||||
).property('content.section.width', 'content.position_x')
|
||||
((@get('content.position_x') || 0) * @get('containerWidth') / section_width) - 40
|
||||
).property('content.section.width', 'content.position_x', 'containerWidth')
|
||||
offsetY: (->
|
||||
return 0 unless section_height = @get('content.section.height')
|
||||
(@content.get('position_y') || 0) * @containerHeight() / section_height
|
||||
).property('content.section.height', 'content.position_y')
|
||||
# debugger if @get('content.number') == 11
|
||||
((@content.get('position_y') || 0) * @get('containerHeight') / section_height) - 20
|
||||
).property('content.section.height', 'content.position_y', 'containerHeight')
|
||||
|
||||
style: (->
|
||||
"position:absolute;width:83px;height:48px;left:#{@get('offsetX')}px;top:#{@get('offsetY')}px"
|
||||
@@ -38,10 +39,11 @@ App.SectionTableView = Ember.View.extend DragNDrop.Draggable,
|
||||
position_y: position.top *@content.get('section').get('height') / @containerHeight()
|
||||
#@content.get('transaction').commit()
|
||||
@content.save()
|
||||
containerWidth: ->
|
||||
$(@get('parentView.element')).width()
|
||||
containerHeight: ->
|
||||
$(@get('parentView.element')).height()
|
||||
containerWidth: (-> @get('parentView.element_width') ).property('parentView.element_width')
|
||||
containerHeight: (-> @get('parentView.element_height') ).property('parentView.element_height')
|
||||
# $(@get('parentView.element')).width()
|
||||
# containerHeight: ->
|
||||
# $(@get('parentView.element')).height()
|
||||
#click: ->
|
||||
#@$('.table-actions').show()
|
||||
didInsertElement: ->
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
App.SectionTablesView = Ember.View.extend DragNDrop.Droppable,
|
||||
classNames: ['well', 'section-tables-container', 'section-tables-active']
|
||||
templateName: 'section_tables'
|
||||
element_width: 0
|
||||
element_height: 0
|
||||
didInsertElement: ->
|
||||
@$el = $(@get('element'))
|
||||
height = @$el.width() * @get('controller.model.height') / @get('controller.model.width')
|
||||
@@ -10,7 +12,10 @@ App.SectionTablesView = Ember.View.extend DragNDrop.Droppable,
|
||||
observeSectionDimensions: (->
|
||||
return unless @get('element')
|
||||
@$el = $(@get('element'))
|
||||
height = @$el.width() * @get('controller.model.height') / @get('controller.model.width')
|
||||
width = @$el.width()
|
||||
height = width * @get('controller.model.height') / @get('controller.model.width')
|
||||
@set 'element_width', width
|
||||
@set 'element_height', height
|
||||
@$el.css('height', height)
|
||||
).observes('controller.model.height', 'controller.model.width')
|
||||
tables: (->@get('content')).property('content')
|
||||
|
||||
Reference in New Issue
Block a user