Fixed #2510 - Zammad Customers shown as Agents in IE.

This commit is contained in:
Billy Zhou 2019-05-29 10:03:55 +02:00 committed by Thorsten Eckel
parent e27079f0a0
commit 4f44edcd8f

View file

@ -32,11 +32,11 @@ class App.ControllerForm extends App.Controller
@form.prepend('<div class="alert alert--danger js-danger js-alert hide" role="alert"></div>') @form.prepend('<div class="alert alert--danger js-danger js-alert hide" role="alert"></div>')
@form.prepend('<div class="alert alert--success js-success hide" role="alert"></div>') @form.prepend('<div class="alert alert--success js-success hide" role="alert"></div>')
if @handlers # Fix for Issue #2510 - Zammad Customers shown as Agents in IE
params = App.ControllerForm.params(@form) # Previously the handlers are called directly, before the DOM elements are ready, thereby causing a race condition under IE11.
for attribute in @attributes # Now we only dispatch the handlers after the DOM is ready.
for handler in @handlers if @handlers.length
handler(params, attribute, @attributes, @idPrefix, @form, @) $(@dispatch_handlers)
# if element is given, prepend form to it # if element is given, prepend form to it
if @el if @el
@ -52,6 +52,12 @@ class App.ControllerForm extends App.Controller
@finishForm = true @finishForm = true
@form @form
dispatch_handlers: =>
params = App.ControllerForm.params(@form)
for attribute in @attributes
for handler in @handlers
handler(params, attribute, @attributes, @idPrefix, @form, @)
showAlert: (message) => showAlert: (message) =>
@form.find('.alert--danger').first().removeClass('hide').html(App.i18n.translateInline(message)) @form.find('.alert--danger').first().removeClass('hide').html(App.i18n.translateInline(message))
@ -428,6 +434,7 @@ class App.ControllerForm extends App.Controller
# get contenteditable # get contenteditable
for element in lookupForm.find('[contenteditable]') for element in lookupForm.find('[contenteditable]')
name = $(element).data('name') name = $(element).data('name')
if name if name
param[name] = $(element).ceg() param[name] = $(element).ceg()