better phone alert and optimization
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
window.Qwaiter=
|
||||
alert: (msg) ->
|
||||
alert(msg)
|
||||
confirm: (options) ->
|
||||
alert: (msg) ->
|
||||
template = @mustache('#alert-template', {title: 'Alert', message: msg, close: 'OK'})
|
||||
$(template).modal()
|
||||
false
|
||||
confirm: (options) ->
|
||||
options ||= {}
|
||||
content = options.content || 'Are you sure?'
|
||||
title = options.title || 'Confirm'
|
||||
@@ -24,6 +26,13 @@ window.Qwaiter=
|
||||
currency: (num) ->
|
||||
num = 0.0 if isNaN(num) || num == '' || num == null
|
||||
'€ ' + parseFloat(num).toFixed(2)
|
||||
mustache: (selector, locals)->
|
||||
locs = $.extend(locals,
|
||||
currency: ->
|
||||
(val)->
|
||||
currency(Mustache.render(val, this))
|
||||
)
|
||||
Mustache.to_html($(selector).html(), locs)
|
||||
|
||||
jQuery.ajaxSetup
|
||||
'beforeSend': (xhr) ->
|
||||
|
||||
@@ -22,7 +22,6 @@ class Quser
|
||||
$('#order-row-'+e.data.id).addClass('active')
|
||||
if(e.event == 'order_being_delivered')
|
||||
$('#order-row-'+e.data.id).addClass('delivered')
|
||||
console.log(e)
|
||||
false
|
||||
home_loader: ->
|
||||
$.getJSON(data_host + '/user/list_info.json?' + authentication_string, (res) => @handle_active_list_default_actions(res))
|
||||
@@ -200,7 +199,7 @@ class Quser
|
||||
body.find('tr').remove()
|
||||
foot.find('tr').remove()
|
||||
if !res.orders && !res.orders.length
|
||||
alert('No orders in list')
|
||||
Qwaiter.alert('No orders in list')
|
||||
return
|
||||
m_obj = res
|
||||
body.append @mustache('#active-list-order-template', new Order(order)) for order in m_obj.orders
|
||||
|
||||
Reference in New Issue
Block a user