Holzweiler Agency

jQuery(document).ready(function($) {
 
	$('.add-new-album').keydown(function(e) {
		if (e.keyCode == 13) {
 
			var new_album_name = $(this).val();
			var imageid = $(this).data("imageid");
			var albumtype = $(this).data("albumtype");
			if (new_album_name.length > 0) {
 
				$(this).val("");
 
	           	var data = {
		           	action: 'lightbox',
		           	lightbox_action: 'add_new_album',
		           	type: albumtype,
		           	new_album_name: new_album_name,
		           	imageid: imageid
 
		        };
 
		        jQuery.post(ajaxurl, data, function(response) {
			        $('.my-albums-wrapper .my-albums').each(function(){
			        	var thisid = $(this).find('li').data('imageid');
			        	var thatclass = '';
 
			        	if(thisid === imageid) {
				        	thatclass = ' already-in-album';
			        	}