vendor/assets/javascripts/quick_script/classes.js.coffee in quick_script-0.9.1 vs vendor/assets/javascripts/quick_script/classes.js.coffee in quick_script-0.9.2
- old
+ new
@@ -128,21 +128,27 @@
Overlay.add = (vm, tmp, options, cls) ->
id = vm.name
template = tmp
cls = cls || ''
options = {} if !options?
- options['z-index'] = Overlay.instance.zindex + 10
- $('body').prepend("<div class='backdrop' id='backdrop-#{id}' style='z-index: #{(Overlay.instance.zindex + 9)}'></div><div id='overlay-" + id + "' class='overlay'><img class='overlay-close' src='/assets/remove.png' data-bind='click : hideOverlay'/><div class='content' data-bind=\"template: '" + template + "'\"></div></div>")
- $('#overlay-' + id).css(options)
- $('#overlay-' + id).addClass(cls)
- $('#overlay-' + id).css({'margin-left' : -1 * $('#overlay-' + id).width() / 2})
- $('.overlay .content').css({'max-height' : ($(window).height() - 100)})
- $('#backdrop-' + id).click =>
- console.log('backdrop clicked.')
- Overlay.remove(id)
- $('#overlay-' + id).koBind(vm)
- Overlay.instance.zindex = Overlay.instance.zindex + 10
+ #options['z-index'] = Overlay.instance.zindex + 10
+ $('body').prepend("<div id='overlay-" + id + "' class='modal hide fade'><button class='close' data-bind='click : hideOverlay'>x</button><div class='content' data-bind=\"template: '" + template + "'\"></div></div>")
+ #$('#overlay-' + id).css(options)
+ #$('#overlay-' + id).addClass(cls)
+ #$('#overlay-' + id).css({'margin-left' : -1 * $('#overlay-' + id).width() / 2})
+ #$('.overlay .content').css({'max-height' : ($(window).height() - 100)})
+ #$('#backdrop-' + id).click =>
+ #console.log('backdrop clicked.')
+ #Overlay.remove(id)
+ setTimeout ->
+ $('#overlay-' + id).koBind(vm)
+ $('#overlay-' + id).modal('show')
+ $('#overlay-' + id).on 'hidden', ->
+ $('#overlay-' + id).koClean()
+ $('#overlay-' + id).remove()
+ , 100
+ #Overlay.instance.zindex = Overlay.instance.zindex + 10
Overlay.dialog = (msg, opts) ->
vm =
name : 'dialog'
message : ko.observable(msg)
@@ -178,12 +184,10 @@
$('body').prepend("<div class='backdrop' id='backdrop-confirm' style='z-index:500'></div><div id='overlay-confirm' class='confirm' style='display: none;'><div class='msg'>" + msg + "</div><div class='opts'><button class='button green' data-bind='click : yes'>yes</button><button class='button red' data-bind='click : no'>no</button></div></div>")
$('#overlay-confirm').koBind(vm)
$('#overlay-confirm').slideDown 'fast'
Overlay.remove = (id) ->
- $('#overlay-' + id).koClean()
- $('#overlay-' + id).remove()
- $('#backdrop-' + id).remove()
+ $('#overlay-' + id).modal('hide')
class @TimeLength
constructor : (@date1, @date2)->
@date2 = new Date() unless @date2?
seconds : ->