Fixed not shown "discard changes" button on reply.

This commit is contained in:
Martin Edenhofer 2016-06-07 22:54:37 +02:00
parent faf4b0ed86
commit 2d91d5b5d7
3 changed files with 5 additions and 7 deletions

View file

@ -397,13 +397,11 @@ class App.TicketZoom extends App.Controller
@main.scrollTop( @main.prop('scrollHeight') ) @main.scrollTop( @main.prop('scrollHeight') )
autosaveStop: => autosaveStop: =>
console.log('autosaveStop')
@clearDelay('ticket-zoom-form-update') @clearDelay('ticket-zoom-form-update')
@autosaveLast = {} @autosaveLast = {}
@el.off('change.local blur.local keyup.local paste.local input.local') @el.off('change.local blur.local keyup.local paste.local input.local')
autosaveStart: => autosaveStart: =>
console.log('autosaveStart')
@el.on('change.local blur.local keyup.local paste.local input.local', 'form, .js-textarea', (e) => @el.on('change.local blur.local keyup.local paste.local input.local', 'form, .js-textarea', (e) =>
@delay(@markForm, 250, 'ticket-zoom-form-update') @delay(@markForm, 250, 'ticket-zoom-form-update')
) )

View file

@ -122,14 +122,14 @@ class App.TicketZoomArticleNew extends App.Controller
# set article type and expand text area # set article type and expand text area
@bind('ui::ticket::setArticleType', (data) => @bind('ui::ticket::setArticleType', (data) =>
return if data.ticket.id isnt @ticket_id return if data.ticket.id.toString() isnt @ticket_id.toString()
@openTextarea(null, true) @openTextarea(null, true)
for key, value of data.article for key, value of data.article
if key is 'body' if key is 'body'
@$('[data-name="' + key + '"]').html(value) @$('[data-name="' + key + '"]').html(value)
else else
@$('[name="' + key + '"]').val(value) @$('[name="' + key + '"]').val(value).trigger('change')
# preselect article type # preselect article type
@setArticleType(data.type.name) @setArticleType(data.type.name)
@ -140,7 +140,7 @@ class App.TicketZoomArticleNew extends App.Controller
# reset new article screen # reset new article screen
@bind('ui::ticket::taskReset', (data) => @bind('ui::ticket::taskReset', (data) =>
return if data.ticket_id isnt @ticket_id return if data.ticket_id.toString() isnt @ticket_id.toString()
@type = 'note' @type = 'note'
@defaults = {} @defaults = {}
@render() @render()
@ -410,7 +410,7 @@ class App.TicketZoomArticleNew extends App.Controller
setArticleType: (type) => setArticleType: (type) =>
wasScrolledToBottom = @isScrolledToBottom() wasScrolledToBottom = @isScrolledToBottom()
@type = type @type = type
@$('[name=type]').val(type) @$('[name=type]').val(type).trigger('change')
@articleNewEdit.attr('data-type', type) @articleNewEdit.attr('data-type', type)
@$('.js-selectableTypes').addClass('hide').filter("[data-type='#{ type }']").removeClass('hide') @$('.js-selectableTypes').addClass('hide').filter("[data-type='#{ type }']").removeClass('hide')

View file

@ -29,7 +29,7 @@ class Edit extends App.ObserverController
return if @resetBind return if @resetBind
@resetBind = true @resetBind = true
@bind('ui::ticket::taskReset', (data) => @bind('ui::ticket::taskReset', (data) =>
return if data.ticket_id isnt ticket.id return if data.ticket_id.toString() isnt ticket.id.toString()
@render(ticket) @render(ticket)
) )