This commit is contained in:
2014-08-13 18:56:58 +02:00
parent 446cf08afb
commit 6da2d7a40e
4 changed files with 17 additions and 13 deletions
@@ -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')
+1 -1
View File
@@ -79,7 +79,7 @@ for action in uc.action_methods
ios_view = ios_view.gsub /(href|src)="\/assets\/([^"]+)/, %|\\1="./assets/\\2| # make assets calls relative
ios_view.sub! /<\/title>/, '</title><script type="text/javascript" src="qmobile.js"></script><script type="text/javascript" src="cordova-2.2.0.js"></script><script type="text/javascript" src="barcodescanner.js"></script>'
ios_view.gsub! '##assets_path##', './assets/'
android_view.gsub! '##platform##', 'ios'
ios_view.gsub! '##platform##', 'ios'
File.open(File.join(ios_root, "#{action}.html"), 'w'){|f| f.puts ios_view}
## MODIFY FOR ANDROID
-3
View File
@@ -46,9 +46,6 @@ Bugs
- Supplier tables pagination styling (make ember!)
- supplier counters in user view (no supplier in active list?)
- supplier main board section selector selects first section option and not the supplier name, which is added using prompt thingy. Maybe setting ApplicationController.active_section in stead of IndexController.active_section for scope locking
- Supplier
- Main dashboard
- Total list price is not working, link with orders not made. Make/Check if there is a spec
Post release
============