Skip to content

Commit

Permalink
Fix #11700: Widgets with trigger/target bind for removal
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Apr 10, 2024
1 parent ac30e44 commit 70f9335
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,6 @@ PrimeFaces.widget.Droppable = PrimeFaces.widget.BaseWidget.extend({
this.bindDropListener();

this.jqTarget.droppable(this.cfg);

this.addDestroyListener(function() {
if ($this.jqTarget.length) {
$this.jqTarget.droppable('destroy');
}
});
},

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ PrimeFaces.widget.Resizable = PrimeFaces.widget.BaseWidget.extend({
if (container) {
var $container = $(container);
if ($container.length) {
var $this = this;
var _self = this;
PrimeFaces.addDeferredRender(this.id, $container.attr('id'), function() {
return $this.render();
return _self.render();
});
}
}
Expand Down Expand Up @@ -106,36 +106,30 @@ PrimeFaces.widget.Resizable = PrimeFaces.widget.BaseWidget.extend({
this.cfg.containment = PrimeFaces.escapeClientId(this.cfg.parentComponentId);
}

var $this = this;
var _self = this;

this.cfg.stop = function(event, ui) {
if($this.cfg.onStop) {
$this.cfg.onStop.call($this, event, ui);
if(_self.cfg.onStop) {
_self.cfg.onStop.call(_self, event, ui);
}

$this.fireAjaxResizeEvent(event, ui);
_self.fireAjaxResizeEvent(event, ui);
};

this.cfg.start = function(event, ui) {
if($this.cfg.onStart) {
$this.cfg.onStart.call($this, event, ui);
if(_self.cfg.onStart) {
_self.cfg.onStart.call(_self, event, ui);
}
};

this.cfg.resize = function(event, ui) {
if($this.cfg.onResize) {
$this.cfg.onResize.call($this, event, ui);
if(_self.cfg.onResize) {
_self.cfg.onResize.call(_self, event, ui);
}
};

this.jqTarget.resizable(this.cfg);

this.addDestroyListener(function() {
if ($this.jqTarget.length) {
$this.jqTarget.resizable('destroy');
}
});

this.removeScriptElement(this.id);
},

Expand Down

0 comments on commit 70f9335

Please sign in to comment.