Created
August 23, 2013 08:07
-
-
Save wegorich/6316727 to your computer and use it in GitHub Desktop.
Simple override default dialog box with fancybox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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