Skip to content

Commit

Permalink
Fix embed not removing metadata on destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
jlukic committed Oct 13, 2018
1 parent c4e307c commit 620cb3f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
6 changes: 6 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## RELEASE NOTES

### Version 2.4.1 - Oct 13, 2018

**Bug Fixes**

- **Embed** - Embed will now correctly remove DOM metadata on `destroy`

### Version 2.4.0 - Sep 17, 2018

> `2.4.0` includes a new component `placeholder`. To use this component in your existing SUI site, be sure to add `@placeholder: 'default';` to your `theme.config`. You can see an example in `theme.config.example`
Expand Down
12 changes: 11 additions & 1 deletion src/definitions/modules/embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

;(function ($, window, document, undefined) {

'use strict';
"use strict";

window = (typeof window != 'undefined' && window.Math == Math)
? window
Expand Down Expand Up @@ -181,6 +181,7 @@ $.fn.embed = function(parameters) {
// clears embed
reset: function() {
module.debug('Clearing embed and showing placeholder');
module.remove.data();
module.remove.active();
module.remove.embed();
module.showPlaceholder();
Expand Down Expand Up @@ -300,6 +301,15 @@ $.fn.embed = function(parameters) {
},

remove: {
data: function() {
$module
.removeData(metadata.id)
.removeData(metadata.icon)
.removeData(metadata.placeholder)
.removeData(metadata.source)
.removeData(metadata.url)
;
},
active: function() {
$module.removeClass(className.active);
},
Expand Down

0 comments on commit 620cb3f

Please sign in to comment.