Browse Source

Fix embed not removing metadata on destroy

pull/6216/merge
Jack 6 years ago
parent
commit
620cb3fda3
2 changed files with 17 additions and 1 deletions
  1. 6
      RELEASE-NOTES.md
  2. 12
      src/definitions/modules/embed.js

6
RELEASE-NOTES.md

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

12
src/definitions/modules/embed.js

@ -10,7 +10,7 @@
;(function ($, window, document, undefined) {
'use strict';
"use strict";
window = (typeof window != 'undefined' && window.Math == Math)
? window
@ -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();
@ -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);
},

Loading…
Cancel
Save