C&V test improvements

This commit is contained in:
2015-09-23 17:14:53 +02:00
parent 735ed9b70d
commit 81d4545104
12 changed files with 33 additions and 14 deletions
@@ -3,6 +3,5 @@ App.BooleanSwitchComponent = Ember.Component.extend
classNames: "switch"
classNameBindings: ['rounded:round']
click: ->
@set 'value', !@get('value')
# UniqueId is used to connect the label and the checkbox to eachother in the template
setUniqueId: (->@set 'switchId', "switch-#{Math.round(Math.random()*1000)}").on('init')
@@ -19,8 +19,11 @@ App.MySelectComponent = Ember.Component.extend
didRender: ->
# Set select to current value if can be found
key = @get('optionValuePath')
index = @get('content').mapBy(key).indexOf(@get("selection.#{key}"))
if @get('identity')
key = @get('optionValuePath')
index = @get('content').mapBy(key).indexOf(@get("selection.#{key}")) # Ember 2.0.1 cannot find real objects yet
else
index = @get('content').indexOf(@get('selection'))
if index > -1
@$('select:first').prop('selectedIndex', index)
@@ -1,6 +1,6 @@
.form-row.name
.form-label.half=t 'attributes.product_category.name'
.form-field.half= input valueBinding="model.name" action="save"
.form-field.half= input value=model.name action="save"
.row
.small-12.medium-6.columns
unless model.supplier.week_starts_on_monday
@@ -28,7 +28,7 @@
if model.supplier.week_starts_on_monday
.form-row.sunday
.form-label.half= t 'date.day_name.sunday'
.form-field.half= boolean-switch valueBinding=model.active_on_sunday
.form-field.half= boolean-switch value=model.active_on_sunday
.small-12.medium-6.columns
.row
.small-12.columns.text-center= boolean-button value=model.full_day reverse=true text_path="product_category.modal.active_between.top"
@@ -109,6 +109,7 @@ header.top-menu
.current-employee-nav
float: right
margin-right: 10px
cursor: pointer
.dropdown-trigger.gravatar
display: inline-block
overflow: hidden