bug fixes
This commit is contained in:
@@ -8,9 +8,10 @@ window.Qwaiter=
|
||||
content = options.content || 'Are you sure?'
|
||||
title = options.title || 'Confirm'
|
||||
wrapper = $('<div class="modal"></div>')
|
||||
callback_wrapper = ->
|
||||
wrapper.modal('hide')
|
||||
options.ok()
|
||||
if typeof(options.ok) == 'function'
|
||||
callback_wrapper = ->
|
||||
wrapper.modal('hide')
|
||||
options.ok()
|
||||
callback_cancel_wrapper = ->
|
||||
wrapper.modal('hide')
|
||||
options.cancel() if options.cancel
|
||||
@@ -18,9 +19,16 @@ window.Qwaiter=
|
||||
.append('<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>')
|
||||
.append('<h3>'+title+'</h3>').appendTo(wrapper)
|
||||
body = $('<div class="modal-body"></div>').append('<p>'+content+'</p>').appendTo(wrapper)
|
||||
ok_button = $('<a href="#" class="btn btn-primary">Yes</a>')
|
||||
if typeof(options.ok) == 'function'
|
||||
ok_button.click(callback_wrapper)
|
||||
else
|
||||
ok_button.click ->
|
||||
eval(options.ok)
|
||||
wrapper.modal('hide')
|
||||
footer = $('<div class="modal-footer"></div>')
|
||||
.append($('<a href="#" class="btn">Close</a>').click(callback_cancel_wrapper))
|
||||
.append($('<a href="#" class="btn btn-primary">Yes</a>').click(callback_wrapper))
|
||||
.append(ok_button)
|
||||
.appendTo(wrapper)
|
||||
wrapper.modal()
|
||||
currency: (num) ->
|
||||
|
||||
Reference in New Issue
Block a user