Re-Enabled some features in new article widget.

This commit is contained in:
Martin Edenhofer 2014-10-02 18:05:40 +02:00
parent fdaae821d4
commit 80b9f5ddad
2 changed files with 20 additions and 50 deletions

View file

@ -681,7 +681,7 @@ class TicketMeta extends App.Controller
class Edit extends App.Controller class Edit extends App.Controller
elements: elements:
'.js-textarea' : 'textarea' '.js-textarea': 'textarea'
'.attachmentPlaceholder': 'attachmentPlaceholder' '.attachmentPlaceholder': 'attachmentPlaceholder'
'.attachmentPlaceholder-inputHolder': 'attachmentInputHolder' '.attachmentPlaceholder-inputHolder': 'attachmentInputHolder'
'.attachmentPlaceholder-hint': 'attachmentHint' '.attachmentPlaceholder-hint': 'attachmentHint'
@ -690,7 +690,7 @@ class Edit extends App.Controller
'.attachmentUpload': 'attachmentUpload' '.attachmentUpload': 'attachmentUpload'
'.attachmentUpload-progressBar':'progressBar' '.attachmentUpload-progressBar':'progressBar'
'.js-percentage': 'progressText' '.js-percentage': 'progressText'
#'.edit-control-item' : 'editControlItem' '.edit-control-item': 'editControlItem'
#'.edit-controls': 'editControls' #'.edit-controls': 'editControls'
#'.recipient-picker': 'recipientPicker' #'.recipient-picker': 'recipientPicker'
#'.recipient-list': 'recipientList' #'.recipient-list': 'recipientList'
@ -733,7 +733,6 @@ class Edit extends App.Controller
e.stopPropagation() e.stopPropagation()
release: => release: =>
#@autosaveStop()
if @subscribeIdTextModule if @subscribeIdTextModule
App.Ticket.unsubscribe(@subscribeIdTextModule) App.Ticket.unsubscribe(@subscribeIdTextModule)
@ -773,13 +772,14 @@ class Edit extends App.Controller
icon: 'note' icon: 'note'
}, },
] ]
console.log('DEvvvvvV', @defaults)
@html App.view('ticket_zoom/edit')( @html App.view('ticket_zoom/edit')(
ticket: ticket ticket: ticket
articleTypes: articleTypes articleTypes: articleTypes
article: @defaults article: @defaults
isCustomer: @isRole('Customer') isCustomer: @isRole('Customer')
) )
@setArticleType(@type)
configure_attributes = [ configure_attributes = [
{ name: 'customer_id', display: 'Recipients', tag: 'user_autocompletion', null: false, placeholder: 'Enter Person or Organisation/Company', minLengt: 2, disableCreateUser: false }, { name: 'customer_id', display: 'Recipients', tag: 'user_autocompletion', null: false, placeholder: 'Enter Person or Organisation/Company', minLengt: 2, disableCreateUser: false },
@ -802,7 +802,7 @@ class Edit extends App.Controller
# show text module UI # show text module UI
if !@isRole('Customer') if !@isRole('Customer')
textModule = new App.WidgetTextModule( textModule = new App.WidgetTextModule(
el: @el el: @$('.js-textarea').parent()
data: data:
ticket: ticket ticket: ticket
) )
@ -922,6 +922,7 @@ class Edit extends App.Controller
@remove_textarea_catcher() @remove_textarea_catcher()
open_textarea: (event, withoutAnimation) => open_textarea: (event, withoutAnimation) =>
console.log('ticketEdit', @ticketEdit.hasClass('is-open'))
if !@ticketEdit.hasClass('is-open') if !@ticketEdit.hasClass('is-open')
duration = 300 duration = 300
@ -940,20 +941,19 @@ class Edit extends App.Controller
complete: => @add_textarea_catcher() complete: => @add_textarea_catcher()
# scroll to bottom # scroll to bottom
# @textarea.velocity "scroll", @textarea.velocity "scroll",
# container: @textarea.scrollParent() container: @textarea.scrollParent()
# offset: 99999 offset: 99999
# duration: 300 duration: 300
# easing: 'easeOutQuad' easing: 'easeOutQuad'
# queue: false queue: false
# @editControlItem.velocity "transition.slideRightIn", @editControlItem.velocity "transition.slideRightIn",
# duration: 300 duration: 300
# stagger: 50 stagger: 50
# drag: true drag: true
# move attachment text to the left bottom (bottom happens automatically) # move attachment text to the left bottom (bottom happens automatically)
@attachmentPlaceholder.velocity @attachmentPlaceholder.velocity
properties: properties:
translateX: -@attachmentInputHolder.position().left + "px" translateX: -@attachmentInputHolder.position().left + "px"
@ -1004,10 +1004,10 @@ class Edit extends App.Controller
options: options:
duration: 300 duration: 300
# @editControlItem.css('display', 'none') @editControlItem.css('display', 'none')
onDragenter: (event) => onDragenter: (event) =>
# on the first event, # on the first event,
# open textarea (it will only open if its closed) # open textarea (it will only open if its closed)
@open_textarea() if @dragEventCounter is 0 @open_textarea() if @dragEventCounter is 0

View file

@ -4,7 +4,7 @@
<div class="bubble-grid horizontal"> <div class="bubble-grid horizontal">
<div class="vertical center edit-controls"> <div class="vertical center edit-controls">
<%- App.User.fullLocal( @S('id') ).avatar(false, 'right', 'zIndex-5') %> <%- App.User.fullLocal( @S('id') ).avatar(false, 'right', 'zIndex-5') %>
<div class="dark pop-select zIndex-7 edit-control-item" style="display: block;"> <div class="dark pop-select zIndex-7 edit-control-item">
<div class="pop-selected u-clickable centered"> <div class="pop-selected u-clickable centered">
<div class="gray <%- @article.type %> channel icon"></div> <div class="gray <%- @article.type %> channel icon"></div>
</div> </div>
@ -18,7 +18,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="visibility-toggle zIndex-7 u-clickable edit-control-item" style="display: block;"> <div class="visibility-toggle zIndex-7 u-clickable edit-control-item">
<div class="internal-visibility centered" title="<%- @T("unset internal") %>"> <div class="internal-visibility centered" title="<%- @T("unset internal") %>">
<div class="internal visibility icon"></div> <div class="internal visibility icon"></div>
</div> </div>
@ -39,37 +39,7 @@
<div class="bubble-arrow"></div> <div class="bubble-arrow"></div>
<div class="js-textarea ticketEdit-body" contenteditable="true" data-name="body"><%= @article.body %></div> <div class="js-textarea ticketEdit-body" contenteditable="true" data-name="body"><%= @article.body %></div>
<!-- .text-bubble grows with textarea (and expanding clone) --> <!-- .text-bubble grows with textarea (and expanding clone) -->
<div class="shortcut dropdown">
<ul class="dropdown-menu" style="width: 240px; max-height: 200px;">
<li><a href="#">shortcut 1</a></li>
<li><a href="#">shortcut 2</a></li>
<li><a href="#">shortcut 3</a></li>
<li><a href="#">shortcut 4</a></li>
<li><a href="#">shortcut 5</a></li>
<li><a href="#">shortcut 6</a></li>
<li><a href="#">shortcut 7</a></li>
<li><a href="#">shortcut 8</a></li>
</ul>
</div>
<div class="attachments"></div> <div class="attachments"></div>
<!--
</div>
<div class="attachment horizontal">
<div class="attachment-name u-highlight">sega-genesis-box.gif</div>
<div class="attachment-size">2.4mb</div>
<div class="attachment-delete js-delete align-right u-clickable">
<div class="delete icon"></div><%- @T('Delete File') %>
</div>
</div>
<div class="attachment horizontal">
<div class="attachment-name u-highlight">license-key.txt</div>
<div class="attachment-size">7kb</div>
<div class="attachment-delete js-delete align-right u-clickable">
<div class="delete icon"></div><%- @T('Delete File') %>
</div>
</div>
</div>-->
<div class="article-attachment u-unclickable"> <div class="article-attachment u-unclickable">
<div class="attachmentPlaceholder"> <div class="attachmentPlaceholder">
<span class="attachmentPlaceholder-hint">Antwort eingeben oder</span> <span class="attachmentPlaceholder-hint">Antwort eingeben oder</span>