Merge branch 'master' of uflows.com:/var/git/qwaiter

This commit is contained in:
2015-01-14 09:09:44 +01:00
2 changed files with 6 additions and 2 deletions
@@ -3,12 +3,15 @@ App.MenuProductComponent = Ember.Component.extend
code_filter: ''
classNames: 'menu-product-container'
classNameBindings: ['menu_product_class', 'editMode:editing']
showProduct: (-> !@get('code_filter') or (@get('product.code') || "").match(@get('code_filter'))).property('code_filter')
showProduct: (->
return true unless filter = @get('code_filter')
(@get('product.code') || "").toLowerCase().indexOf(filter.toLowerCase()) >= 0
).property('code_filter')
menu_product_class: (-> "menu-product-#{@get('product.id') || 'new'}").property('product.id')
code_filter_display: (->
return new Ember.Handlebars.SafeString(' ') unless code = @get('product.code')
return code unless filter = @get('code_filter')
index = code.indexOf(filter)
index = code.toLowerCase().indexOf(filter.toLowerCase())
if index >= 0
pre_code = code.substring(0,index)
highlight = code.substring(index,index + filter.length)
@@ -46,6 +46,7 @@ App.ApplicationRoute = Ember.Route.extend
controller = @controllerFor("modals/#{modalName}")
catch error
controller = @controllerFor("modals/base")
controller ||= @controllerFor("modals/base")
controller.set 'model', options.model
defaultModalOptions =
closeOnOverlay: true