Skip to content

Commit

Permalink
Merge pull request #2698 in SW/shopware from sw-11932/5.0/fix-plugin-…
Browse files Browse the repository at this point in the history
…cleanup-with-alias to 5.0

* commit '73cba8cc3ac77e68560888aa792781f739c12bba':
  SW-11932 - Fix plugin data not cleaning up with alias keyword
  • Loading branch information
Marcel Schmäing committed Jul 1, 2015
2 parents 7087aa3 + 73cba8c commit b218083
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@

me.$el.removeData('plugin_' + name);

if (me.alias) {
me.$el.removeData('plugin_' + me.alias);
}

/** @deprecated - will be removed in 5.1 */
$.publish('plugin/' + name + '/destroy', [ me ]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,8 @@
len = $el.length,
i = 0,
$currentEl,
plugin;
plugin,
alias;

if (!len) {
return;
Expand All @@ -1003,6 +1004,10 @@
$currentEl = $($el[i]);

if ((plugin = $currentEl.data(name))) {
if (alias = plugin.alias) {
$currentEl.removeData('plugin_' + alias);
}

plugin.destroy();
$currentEl.removeData(name);
}
Expand Down

0 comments on commit b218083

Please sign in to comment.