chapter_07/18_simple_modal_dialog/index.html
in book
jQ ninja 2e

modal opens but do not close(removed), i failed debug:

Code:
$(document).ready(function(){
	$('#eulaOpen').click(function() {
		openDialog('#eula');
	});

	$('#eula').find('.ok, .cancel')
	.on('click', function() {
		closeDialog(this);
	})
	.end()
		.find('.ok')
		.on('click', function(){
			// Clicked Agree!
			console.log('clicked agree!');
			//closeDialog(this);
		})
	.end()
		.find('.cancel')
		.on('click', function() {
			// Clicked disagree!
			console.log('clicked disagree!');
			//closeDialog(this);
		});
});

function openDialog(selector) {
	$(selector)
		.clone()
		.appendTo('#overlay')
		.show()
		.parent()
		.fadeIn('fast');
}
	
function closeDialog(selector) {
	$(selector)
	.parents('#overlay')
	.fadeOut('fast', function() {
		$(this)
			.find('.dialog')
			.remove();
	});
}