I'd like to run
_this.showDialogBox(e);
before
if(!(e.target.id === "primary-checkbox") { $('mini-box').hide(); }
using
$.when().done( function(e){ });