diff --git a/app/assets/javascripts/app/controllers/ticket_zoom/article_new.coffee b/app/assets/javascripts/app/controllers/ticket_zoom/article_new.coffee index 3045db8a4..31435440b 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom/article_new.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom/article_new.coffee @@ -21,12 +21,9 @@ class App.TicketZoomArticleNew extends App.Controller 'click .js-toggleVisibility': 'toggleVisibility' 'click .js-articleTypeItem': 'selectArticleType' 'click .js-selectedArticleType': 'showSelectableArticleType' - 'click .recipient-picker': 'toggle_recipients' - 'click .recipient-list': 'stopPropagation' 'click .js-mail-inputs': 'stopPropagation' 'click .js-writeArea': 'stopPropagation' 'click .list-entry-type div': 'change_type' - 'submit .recipient-list form': 'add_recipient' 'focus .js-textarea': 'openTextarea' #'dragenter': 'onDragenter' #'dragleave': 'onDragleave' @@ -231,72 +228,10 @@ class App.TicketZoomArticleNew extends App.Controller ) @subscribeIdTextModule = ticket.subscribe( callback ) - toggle_recipients: => - if !@pickRecipientsCatcher - @show_recipients() - else - @hide_recipients() - - show_recipients: -> - padding = 15 - - @recipientPicker.addClass('is-open') - @recipientList.removeClass('hide') - - pickerDimensions = @recipientPicker.get(0).getBoundingClientRect() - availableHeight = @recipientPicker.scrollParent().outerHeight() - - top = pickerDimensions.height/2 - @recipientList.height()/2 - bottomDistance = availableHeight - padding - (pickerDimensions.top + top + @recipientList.height()) - - if bottomDistance < 0 - top += bottomDistance - - arrowCenter = -top + pickerDimensions.height/2 - - @recipientListArrow.css('top', arrowCenter) - @recipientList.css('top', top) - - $.Velocity.hook(@recipientList, 'transformOriginX', '0') - $.Velocity.hook(@recipientList, 'transformOriginY', "#{ arrowCenter }px") - - @recipientList.velocity - properties: - scale: [ 1, 0 ] - opacity: [ 1, 0 ] - options: - speed: 300 - easing: [ 0.34, 1.61, 0.7, 1 ] - - @pickRecipientsCatcher = new App.ClickCatcher - holder: @el.offsetParent() - callback: @hide_recipients - zIndexScale: 6 - - hide_recipients: => - @pickRecipientsCatcher.remove() - @pickRecipientsCatcher = null - - @recipientPicker.removeClass('is-open') - - @recipientList.velocity - properties: - scale: [ 0, 1 ] - opacity: [ 0, 1 ] - options: - speed: 300 - easing: [ 500, 20 ] - complete: -> @recipientList.addClass('hide') - change_type: (e) -> $(e.target).addClass('active').siblings('.active').removeClass('active') # store $(this).data('value') - add_recipient: (e) -> - e.stopPropagation() - e.preventDefault() - # store recipient - toggleVisibility: (event) -> event.stopPropagation() if @articleNewEdit.hasClass 'is-public' diff --git a/app/assets/javascripts/app/views/ticket_zoom/article_new.jst.eco b/app/assets/javascripts/app/views/ticket_zoom/article_new.jst.eco index 4d5e1d8a0..79a1e413e 100644 --- a/app/assets/javascripts/app/views/ticket_zoom/article_new.jst.eco +++ b/app/assets/javascripts/app/views/ticket_zoom/article_new.jst.eco @@ -33,12 +33,6 @@
-