fix flow to work
This commit is contained in:
@@ -107,17 +107,28 @@ root.Qrammer =
|
||||
Qrammer.handle_active_user_list_default_actions()
|
||||
)
|
||||
handle_active_user_list_default_actions: ->
|
||||
Qrammer.list_needs_payment_default_action()
|
||||
Qrammer.list_needs_help_default_action()
|
||||
list_needs_help_default_action: ->
|
||||
needs_help_container = $('#list-needs-help-button')
|
||||
if needs_help_container.length
|
||||
if window.active_list.needs_help
|
||||
needs_help_container.html('Help requested')
|
||||
needs_help_container.html('<i class="icon-hand-up"></i>')
|
||||
else
|
||||
needs_help_container.html($('<button class="btn btn-info">I have a question</button>').click(Qrammer.list_needs_help)) #TODO TEXT
|
||||
list_needs_help: ->
|
||||
return unless window.active_list && !window.active_list.needs_help
|
||||
$.post('/active_user_list_needs_help.json', (res) -> window.active_list = res; Qrammer.list_needs_help_default_action())
|
||||
list_needs_payment_default_action: ->
|
||||
needs_payment_container = $('#list-needs-payment-button')
|
||||
if needs_payment_container.length
|
||||
if window.active_list.needs_payment
|
||||
needs_payment_container.html('<i class="icon-check"></i>')
|
||||
else
|
||||
needs_payment_container.html($('<button class="btn btn-warning">Check please</button>').click(Qrammer.list_needs_payment)) #TODO TEXT
|
||||
list_needs_payment: ->
|
||||
return unless window.active_list && !window.active_list.needs_payment
|
||||
$.post('/active_user_list_needs_payment.json', (res) -> window.active_list = res; Qrammer.list_needs_payment_default_action())
|
||||
|
||||
load_active_lists: (supplier_id) ->
|
||||
$.get('/suppliers/'+supplier_id+'/active_lists.json', (res) ->
|
||||
@@ -158,6 +169,8 @@ root.Qrammer =
|
||||
)
|
||||
active_user_list: (list_id) ->
|
||||
$.get('/lists/'+list_id+'/current.json', (res) ->
|
||||
window.active_list = res
|
||||
Qrammer.handle_active_user_list_default_actions()
|
||||
body = $('#active-list-table tbody')
|
||||
foot = $('#active-list-table tfoot')
|
||||
body.find('tr').remove()
|
||||
|
||||
Reference in New Issue
Block a user