Ember temp commit

This commit is contained in:
2013-09-24 08:47:30 +02:00
parent ebbb5dedfc
commit 5650ada04c
71 changed files with 595 additions and 66 deletions
@@ -0,0 +1,40 @@
Qsupplier.App.SectionTableView = Ember.View.extend DragNDrop.Draggable,
templateName: 'table'
classNames: ['section-table']
classNameBindings: [
'content.active_list:occupied',
'controller.editmode:draggable',
'content.active_list.needs_help:needs_help',
'content.active_list.needs_payment:needs_payment',
'content.active_list.has_active_orders:active_order'
]
offsetX: ->
(@content.get('position_x') || 0) * @containerWidth() / (@content.get('section').get('width') || 1)
offsetY: (->
(@content.get('position_y') || 0) * @containerHeight() / (@content.get('section').get('height') || 1)
)
activeList: (->
!!@get('content.active_list_id')
).property('content.active_list_id')
attributeBindings: ['style']
style: (->
"position:absolute;width:83px;height:48px"
).property()
draggable: (-> if @get('controller.editmode') then 'true' else 'false' ).property('controller.editmode')
placeInSection: ->
@$el.css 'left', @offsetX()
@$el.css 'top', @offsetY()
didInsertElement: ->
@$el = $ @get('element')
@placeInSection()
positionChange: (position)->
@$el.css 'left', position.left
@$el.css 'top', position.top
@content.setProperties
position_x: position.left*@content.get('section').get('width') / @containerWidth()
position_y: position.top *@content.get('section').get('height') / @containerHeight()
@content.get('transaction').commit()
containerWidth: ->
$(@get('parentView.element')).width()
containerHeight: ->
$(@get('parentView.element')).height()