Unbind events after widget gets cleared from DOM to avoid calling events like onchange for second time (eg. infolog projectmanager selection)

This commit is contained in:
Hadi Nategh 2018-10-12 11:29:21 +02:00
parent 747e0ecda1
commit 01a54413a2

View File

@ -590,6 +590,13 @@ var et2_link_entry = (function(){ "use strict"; return et2_inputWidget.extend(
this.request = null;
this.createInputWidget();
var self = this;
jQuery(this.getInstanceManager().DOMContainer).on('clear', function(){
// We need to unbind events to prevent a second triggerd event handler
// (eg. setting a project in infolog edit dialog) when the widget gets cleared.
jQuery(self.getDOMNode()).off();
});
},
destroy: function() {