|  |  |  | @ -1,23 +1,25 @@ | 
			
		
	
		
			
				
					|  |  |  |  | (function () { | 
			
		
	
		
			
				
					|  |  |  |  |     $(document).ready(function () { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         function initReactionSelection(){ | 
			
		
	
		
			
				
					|  |  |  |  |             var $this = $(this); | 
			
		
	
		
			
				
					|  |  |  |  |             var $availableReactions = $this.find('.cms-reaction-selection-available-reactions'); | 
			
		
	
		
			
				
					|  |  |  |  |         function initReactionSelection() { | 
			
		
	
		
			
				
					|  |  |  |  |             var $wrapper = $(this); | 
			
		
	
		
			
				
					|  |  |  |  |             var $availableReactions = $wrapper.find('.cms-reaction-selection-available-reactions'); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             $availableReactions.find('.cms-reaction-icon').each(function(){ | 
			
		
	
		
			
				
					|  |  |  |  |             $wrapper.find('.cms-reaction-icon').each(function () { | 
			
		
	
		
			
				
					|  |  |  |  |                 var $icon = $(this); | 
			
		
	
		
			
				
					|  |  |  |  |                 $icon.click(function(){ | 
			
		
	
		
			
				
					|  |  |  |  |                     volo.cmsKit.reactions.reactionPublic.create({ | 
			
		
	
		
			
				
					|  |  |  |  |                         entityType: $this.attr('data-entity-type'), | 
			
		
	
		
			
				
					|  |  |  |  |                         entityId: $this.attr('data-entity-id'), | 
			
		
	
		
			
				
					|  |  |  |  |                 $icon.click(function () { | 
			
		
	
		
			
				
					|  |  |  |  |                     var methodName = $icon.hasClass('cms-reaction-icon-selected') ? 'delete' : 'create'; | 
			
		
	
		
			
				
					|  |  |  |  |                     volo.cmsKit.reactions.reactionPublic[methodName]({ | 
			
		
	
		
			
				
					|  |  |  |  |                         entityType: $wrapper.attr('data-entity-type'), | 
			
		
	
		
			
				
					|  |  |  |  |                         entityId: $wrapper.attr('data-entity-id'), | 
			
		
	
		
			
				
					|  |  |  |  |                         reactionName: $icon.attr('data-name') | 
			
		
	
		
			
				
					|  |  |  |  |                     }).then(function () { | 
			
		
	
		
			
				
					|  |  |  |  |                         location.reload(); //TODO: JUST TESTING !!!!!!!!
 | 
			
		
	
		
			
				
					|  |  |  |  |                     }); | 
			
		
	
		
			
				
					|  |  |  |  |                 }); | 
			
		
	
		
			
				
					|  |  |  |  |             }); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         $('.cms-reaction-selection').each(initReactionSelection); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     }); | 
			
		
	
		
			
				
					|  |  |  |  | })(); | 
			
		
	
	
		
			
				
					|  |  |  | 
 |