Zionetrix::Git
Repositories
Help
Report an Issue
MyCo
Code
Commits
Branches
Tags
Search
Tree:
24f07b6
Branches
Tags
master
MyCo
inc
myco_confirm.js
Initial commit
Benjamin Renard
commited
24f07b6
at 2014-01-06 00:46:22
myco_confirm.js
Blame
History
Raw
var _myconfirm={ 'onconfirm': null, 'oncancel': null, 'data': null }; myconfirm=function(question,onconfirm,oncancel,data) { $('#confirm_modal #question').html(question); _myconfirm={ 'onconfirm': onconfirm, 'oncancel': oncancel, 'data': data }; $('#confirm_modal').modal('show'); } _myconfirm_on_valid_click=function(e) { $('#confirm_modal').modal('hide'); console.log(jQuery.type(_myconfirm.onconfirm)); if (jQuery.type(_myconfirm.onconfirm) == 'function') { _myconfirm.onconfirm(_myconfirm.data); } } _myconfirm_on_cancel_click=function(e) { $('#confirm_modal').modal('hide'); if (jQuery.type(_myconfirm.oncancel) == 'function') { _myconfirm.oncancel(_myconfirm.data); } } $( document ).ready( function() { $('#confirm_modal_submit').bind('click',_myconfirm_on_valid_click); $('#confirm_modal .cancel').bind('click',_myconfirm_on_cancel_click); });