Improved task icon/loading behaviour.

This commit is contained in:
Martin Edenhofer 2015-01-20 08:40:58 +01:00
parent 0740ffdb5d
commit ed81a4f7e2

View file

@ -43,16 +43,25 @@ class App.TicketZoom extends App.Controller
) )
meta: => meta: =>
# default attributes
meta = meta =
url: @url() url: @url()
id: @ticket_id id: @ticket_id
iconClass: 'priority'
head: @taskTitle # set icon and tilte if defined
if @taskIconClass
meta.iconClass = @taskIconClass
if @taskHead
meta.head = @taskHead
# set icon and title based on ticket
if @ticket if @ticket
@ticket = App.Ticket.fullLocal( @ticket.id ) @ticket = App.Ticket.fullLocal( @ticket.id )
meta.head = @ticket.title meta.head = @ticket.title
meta.title = '#' + @ticket.number + ' - ' + @ticket.title meta.title = '#' + @ticket.number + ' - ' + @ticket.title
meta.class = "level-#{@ticket.level()}" meta.class = "level-#{@ticket.level()}"
meta.iconClass = 'priority'
meta meta
url: => url: =>
@ -118,15 +127,19 @@ class App.TicketZoom extends App.Controller
# show error message # show error message
if xhr.status is 401 || error is 'Unauthorized' if xhr.status is 401 || error is 'Unauthorized'
@taskTitle = '» ' + App.i18n.translateInline('Unauthorized') + ' «' @taskHead = '» ' + App.i18n.translateInline('Unauthorized') + ' «'
@taskIconClass = 'error'
@html App.view('generic/error/unauthorized')( objectName: 'Ticket' ) @html App.view('generic/error/unauthorized')( objectName: 'Ticket' )
else if xhr.status is 404 || error is 'Not Found' else if xhr.status is 404 || error is 'Not Found'
@taskTitle = '» ' + App.i18n.translateInline('Not Found') + ' «' @taskHead = '» ' + App.i18n.translateInline('Not Found') + ' «'
@taskIconClass = 'error'
@html App.view('generic/error/not_found')( objectName: 'Ticket' ) @html App.view('generic/error/not_found')( objectName: 'Ticket' )
else else
@taskTitle = '» ' + App.i18n.translateInline('Error') + ' «' @taskHead = '» ' + App.i18n.translateInline('Error') + ' «'
status = xhr.status @taskIconClass = 'error'
detail = xhr.responseText
status = xhr.status
detail = xhr.responseText
if !status && !detail if !status && !detail
detail = 'General communication error, maybe internet is not available!' detail = 'General communication error, maybe internet is not available!'
@html App.view('generic/error/generic')( @html App.view('generic/error/generic')(
@ -441,7 +454,7 @@ class App.TicketZoom extends App.Controller
) )
# set see more options # set see more options
previewHeight = 240 previewHeight = 270
@$('.textBubble-content').each( (index) -> @$('.textBubble-content').each( (index) ->
bubble = $( @ ) bubble = $( @ )
heigth = bubble.height() heigth = bubble.height()
@ -1450,7 +1463,7 @@ class ArticleView extends App.Controller
unfold: (e) -> unfold: (e) ->
e.preventDefault() e.preventDefault()
e.stopPropagation() e.stopPropagation()
container = $(e.currentTarget).parents('.textBubble-content') container = $(e.currentTarget).parents('.textBubble-content')
overflowContainer = container.find('.textBubble-overflowContainer') overflowContainer = container.find('.textBubble-overflowContainer')
overflowContainer.velocity overflowContainer.velocity