Skip to content

Instantly share code, notes, and snippets.

@wegorich
Created August 23, 2013 08:07
Show Gist options
  • Save wegorich/6316727 to your computer and use it in GitHub Desktop.
Save wegorich/6316727 to your computer and use it in GitHub Desktop.
Simple override default dialog box with fancybox
helpers ||= {}
helpers.showMessage = (title, content)->
$.fancybox(['<div class="auth"><div class="block">',
'<h2>',title,'<a href="#" class="btn-close"><i class="icon-remove"></i></a></h2>',
'<div>',content,'</div>',
'</div></div>'].join(''),{
wrapCSS: 'modal'
closeBtn : false
})
helpers.showConfirmBox = (data)->
data ||= {}
$.fancybox(['<div class="auth"><div class="block">',
'<h2>',data.title,'</h2>',
'<div>',data.content,'</div>',
'<div class="input">',
'<a href="#" class="btn btn-sub-gray-green r">', data.no || 'Нет','</a>',
'<a href="#" class="btn btn-light-green">', data.yes || 'Да','</a>',
'</div>',
'</div></div>'].join(''),{
wrapCSS: 'modal'
afterShow: ()->
if data.callback
$('.auth .btn').on 'click', ()->
data.callback($(this).hasClass('btn-light-green'))
return false
closeBtn : false
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment