Skip to content

Commit

Permalink
SW-11932 - Fix plugin data not cleaning up with alias keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
Dieter Giesler committed Jul 1, 2015
1 parent 9580662 commit 73cba8c
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 73cba8c

Please sign in to comment.