Remove meta params of form.
This commit is contained in:
parent
5fd5f4318a
commit
5c94682caf
1 changed files with 11 additions and 5 deletions
|
@ -602,11 +602,17 @@ class App.TicketZoom extends App.Controller
|
||||||
|
|
||||||
# get diff of model
|
# get diff of model
|
||||||
modelDiff =
|
modelDiff =
|
||||||
ticket: App.Utils.formDiff(currentParams.ticket, currentStore.ticket)
|
ticket: @forRemoveMeta(App.Utils.formDiff(currentParams.ticket, currentStore.ticket))
|
||||||
article: App.Utils.formDiff(currentParams.article, currentStore.article)
|
article: @forRemoveMeta(App.Utils.formDiff(currentParams.article, currentStore.article))
|
||||||
|
|
||||||
modelDiff
|
modelDiff
|
||||||
|
|
||||||
|
forRemoveMeta: (params = {}) ->
|
||||||
|
paramsNew = {}
|
||||||
|
for key, value of params
|
||||||
|
if !key.match(/_completion$/)
|
||||||
|
paramsNew[key] = value
|
||||||
|
paramsNew
|
||||||
|
|
||||||
markFormDiff: (diff = {}) =>
|
markFormDiff: (diff = {}) =>
|
||||||
ticketForm = @$('.edit')
|
ticketForm = @$('.edit')
|
||||||
ticketSidebar = @$('.tabsSidebar-tab[data-tab="ticket"]')
|
ticketSidebar = @$('.tabsSidebar-tab[data-tab="ticket"]')
|
||||||
|
@ -614,8 +620,8 @@ class App.TicketZoom extends App.Controller
|
||||||
resetButton = @$('.js-reset')
|
resetButton = @$('.js-reset')
|
||||||
|
|
||||||
params = {}
|
params = {}
|
||||||
params.ticket = @formParam(ticketForm)
|
params.ticket = @forRemoveMeta(@formParam(ticketForm))
|
||||||
params.article = @formParam(articleForm)
|
params.article = @forRemoveMeta(@formParam(articleForm))
|
||||||
|
|
||||||
# clear all changes
|
# clear all changes
|
||||||
if _.isEmpty(diff.ticket) && _.isEmpty(diff.article)
|
if _.isEmpty(diff.ticket) && _.isEmpty(diff.article)
|
||||||
|
|
Loading…
Reference in a new issue