Add some top menu logic
This commit is contained in:
@@ -66,3 +66,5 @@ App.ApplicationController = Ember.Controller.extend
|
||||
error_list.eraseRecord()
|
||||
@set 'list', null
|
||||
@store.find('list', 'current').then(success, error)
|
||||
didInsertElement: (e)->
|
||||
debugger
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
App.ApplicationRoute = Ember.Route.extend
|
||||
setupController: (controller)->
|
||||
#@controllerFor('product_orders').set 'model', @store.filter('product_order', (po)-> !po.get('order')) # does not work (yet)
|
||||
debugger
|
||||
@controllerFor('product_orders').set 'model', @store.filter('product_order', (po)-> !po.get('id'))
|
||||
controller.secured ->
|
||||
faye = new Faye.Client($event_host)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.top-menu.off-canvas-wrap
|
||||
/.top-menu.off-canvas-wrap
|
||||
.inner-wrap
|
||||
nav.tab-bar
|
||||
section.left-small
|
||||
@@ -46,4 +46,51 @@
|
||||
span= notice
|
||||
= outlet
|
||||
a.exit-off-canvas
|
||||
header.top-menu
|
||||
.toggle-side-menu
|
||||
span
|
||||
.menu-content
|
||||
section.main-buttons
|
||||
link-to 'index'
|
||||
= image_tag 'icons/logo-small.png'
|
||||
if list.id
|
||||
App.MenuItemView route="active_list"
|
||||
App.MenuItemView route='table' route_param=list.table.id
|
||||
App.MenuItemListNeedsHelpView
|
||||
App.MenuItemListNeedsPaymentView
|
||||
aside.side-menu
|
||||
ul
|
||||
li
|
||||
label Menu
|
||||
li
|
||||
= link-to 'index'
|
||||
span Home
|
||||
li
|
||||
a{action scanQr bubbles=false}
|
||||
span Scan QR
|
||||
if list.id
|
||||
li
|
||||
=link-to 'table' list.table.id
|
||||
span= t 'list_products.title'
|
||||
li
|
||||
=link-to 'active_list'
|
||||
span= t 'active_list.title'
|
||||
li
|
||||
=link-to 'lists'
|
||||
span= t 'models.plural.list'
|
||||
li
|
||||
=link-to 'join_requests'
|
||||
span= t 'models.plural.join_request'
|
||||
li
|
||||
a{action openDebugger}
|
||||
span.fa.fa-wrench.fa-lg
|
||||
span Debugger
|
||||
main.main-section
|
||||
.main-section-content
|
||||
if notice
|
||||
#notice.alert-box{action clearNotice} data-alert=true
|
||||
a.right href="#"
|
||||
span.fa.fa-times.fa-lg
|
||||
span= notice
|
||||
= outlet
|
||||
=outlet modal
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
App.ApplicationView = Ember.View.extend
|
||||
didInsertElement: ->
|
||||
$('.main-section').css 'min-height', ($(window).height() - $('.tab-bar:first').outerHeight())
|
||||
|
||||
$('.toggle-side-menu,.side-menu').click ->
|
||||
menu = $('aside.side-menu')
|
||||
toggle = $('.toggle-side-menu')
|
||||
if menu.is(':visible')
|
||||
menu.animate left: -255, -> $(@).hide()
|
||||
toggle.animate left: 0, -> $(@).removeClass('open')
|
||||
else
|
||||
menu.show().animate left: 0
|
||||
toggle.animate left: 222 - 30, -> $(@).addClass('open')
|
||||
|
||||
$(document).foundation()
|
||||
@@ -1,7 +1,7 @@
|
||||
App.MenuItemListNeedsHelpView = Ember.View.extend Ember.ViewTargetActionSupport,
|
||||
action: 'listNeedsHelp'
|
||||
templateName: "menu_item_list_needs_help"
|
||||
classNames: 'menu-list-item'
|
||||
classNames: 'menu-list-item callout'
|
||||
classNameBindings: ['controller.list.needs_help:active']
|
||||
click: ->
|
||||
if @get('controller.list.needs_help')
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
App.MenuItemListNeedsPaymentView = Ember.View.extend Ember.ViewTargetActionSupport,
|
||||
action: 'listNeedsPayment'
|
||||
templateName: "menu_item_list_needs_payment"
|
||||
classNames: 'menu-list-item'
|
||||
classNames: 'menu-list-item callout'
|
||||
classNameBindings: ['controller.list.needs_payment:active']
|
||||
click: ->
|
||||
if @get('controller.list.needs_payment')
|
||||
|
||||
@@ -20,7 +20,4 @@
|
||||
|
||||
$.extend($translations.en, <%= I18n.t('user', locale: :en).to_json %>);
|
||||
$.extend($translations.nl, <%= I18n.t('user', locale: :nl).to_json %>);
|
||||
$(document).foundation()
|
||||
setLocale()
|
||||
$ ->
|
||||
$('.main-section').css 'min-height', ($(window).height() - $('.tab-bar:first').outerHeight())
|
||||
|
||||
Reference in New Issue
Block a user