;(function($,_,undefined){"use strict";ips.controller.register('core.front.system.promote',{initialize:function(){this.on(window,'resize',this.resizeContentArea);this.on('click','[data-action="selectImage"]',this.selectImage);this.setup();},setup:function(){this.resizeContentArea();},expandTextarea:function(e){e.preventDefault();$('#eOriginalText').removeClass('cPromote_text_fade').addClass('cPromote_text_expanded');this.scope.find('[data-action="expandTextarea"]').hide();},selectImage:function(e){e.preventDefault();var image=$(e.currentTarget);var check=image.find('input[type="checkbox"]');var select=image.find('.ipsAttach_selection');var wrap=image.closest('.cPromote_attachImage');select.toggleClass('ipsAttach_selectionOn',!check.is(':checked'));wrap.toggleClass('cPromote_attachImageSelected',!check.is(':checked'));check.prop('checked',!check.is(':checked')).trigger('change');},resizeContentArea:function(){if(!this.scope.closest('.ipsDialog').length){return;}
var dialogHeight=this.scope.closest('.ipsDialog_content').outerHeight();var controlsHeight=this.scope.find('.cPromoteSubmit').outerHeight();this.scope.find('[data-role="promoteDialogBody"]').css({paddingBottom:controlsHeight+30+'px',height:(dialogHeight-80)+'px',overflow:'auto'});}});}(jQuery,_));;