Improved task icon/loading behaviour.
This commit is contained in:
parent
0740ffdb5d
commit
ed81a4f7e2
1 changed files with 26 additions and 13 deletions
|
@ -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,13 +127,17 @@ 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') + ' «'
|
||||||
|
@taskIconClass = 'error'
|
||||||
|
|
||||||
status = xhr.status
|
status = xhr.status
|
||||||
detail = xhr.responseText
|
detail = xhr.responseText
|
||||||
if !status && !detail
|
if !status && !detail
|
||||||
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue