Skip to content

Commit 620cb3f

Browse files
committed
Fix embed not removing metadata on destroy
1 parent c4e307c commit 620cb3f

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

RELEASE-NOTES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
## RELEASE NOTES
22

3+
### Version 2.4.1 - Oct 13, 2018
4+
5+
**Bug Fixes**
6+
7+
- **Embed** - Embed will now correctly remove DOM metadata on `destroy`
8+
39
### Version 2.4.0 - Sep 17, 2018
410

511
> `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`

src/definitions/modules/embed.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

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

13-
'use strict';
13+
"use strict";
1414

1515
window = (typeof window != 'undefined' && window.Math == Math)
1616
? window
@@ -181,6 +181,7 @@ $.fn.embed = function(parameters) {
181181
// clears embed
182182
reset: function() {
183183
module.debug('Clearing embed and showing placeholder');
184+
module.remove.data();
184185
module.remove.active();
185186
module.remove.embed();
186187
module.showPlaceholder();
@@ -300,6 +301,15 @@ $.fn.embed = function(parameters) {
300301
},
301302

302303
remove: {
304+
data: function() {
305+
$module
306+
.removeData(metadata.id)
307+
.removeData(metadata.icon)
308+
.removeData(metadata.placeholder)
309+
.removeData(metadata.source)
310+
.removeData(metadata.url)
311+
;
312+
},
303313
active: function() {
304314
$module.removeClass(className.active);
305315
},

0 commit comments

Comments
 (0)