dot-store-iframe
Advanced tools
Comparing version 2.6.3 to 2.6.7
@@ -11,3 +11,3 @@ "use strict"; | ||
exports.createDfpSlot = createDfpSlot; | ||
exports.destroyDfpSlot = destroyDfpSlot; | ||
exports.deleteDfpSlot = deleteDfpSlot; | ||
exports.refreshDfpSlot = refreshDfpSlot; | ||
@@ -192,11 +192,11 @@ exports.updateDfpTargets = updateDfpTargets; | ||
function destroyDfpSlot(_x3) { | ||
return _destroyDfpSlot.apply(this, arguments); | ||
function deleteDfpSlot(_x3) { | ||
return _deleteDfpSlot.apply(this, arguments); | ||
} | ||
function _destroyDfpSlot() { | ||
_destroyDfpSlot = (0, _asyncToGenerator2.default)( | ||
function _deleteDfpSlot() { | ||
_deleteDfpSlot = (0, _asyncToGenerator2.default)( | ||
/*#__PURE__*/ | ||
_regenerator.default.mark(function _callee3(_ref6) { | ||
var iframeId, state, store, iframes, iframe, valid; | ||
var iframeId, prevState, store, iframes, iframe, valid; | ||
return _regenerator.default.wrap(function _callee3$(_context3) { | ||
@@ -206,4 +206,4 @@ while (1) { | ||
case 0: | ||
iframeId = _ref6.iframeId, state = _ref6.state, store = _ref6.store; | ||
iframes = state.iframes; | ||
iframeId = _ref6.iframeId, prevState = _ref6.prevState, store = _ref6.store; | ||
iframes = prevState.iframes; | ||
iframe = iframes[iframeId]; | ||
@@ -234,3 +234,3 @@ valid = iframe && iframe.dfp; | ||
})); | ||
return _destroyDfpSlot.apply(this, arguments); | ||
return _deleteDfpSlot.apply(this, arguments); | ||
} | ||
@@ -237,0 +237,0 @@ |
@@ -9,2 +9,3 @@ "use strict"; | ||
exports.createIframe = createIframe; | ||
exports.deleteIframe = deleteIframe; | ||
exports.iframeSize = iframeSize; | ||
@@ -70,2 +71,45 @@ | ||
function deleteIframe(_x2) { | ||
return _deleteIframe.apply(this, arguments); | ||
} | ||
function _deleteIframe() { | ||
_deleteIframe = (0, _asyncToGenerator2.default)( | ||
/*#__PURE__*/ | ||
_regenerator.default.mark(function _callee2(_ref) { | ||
var iframeId, prevState, iframes, iframe, valid, divId, el; | ||
return _regenerator.default.wrap(function _callee2$(_context2) { | ||
while (1) { | ||
switch (_context2.prev = _context2.next) { | ||
case 0: | ||
iframeId = _ref.iframeId, prevState = _ref.prevState; | ||
iframes = prevState.iframes; | ||
iframe = iframes[iframeId]; | ||
valid = iframe && !iframe.dfp; | ||
if (valid) { | ||
_context2.next = 6; | ||
break; | ||
} | ||
return _context2.abrupt("return"); | ||
case 6: | ||
divId = iframe.divId; | ||
el = document.getElementById(divId); | ||
if (el && el.parentNode) { | ||
el.parentNode.removeChild(el); | ||
} | ||
case 9: | ||
case "end": | ||
return _context2.stop(); | ||
} | ||
} | ||
}, _callee2, this); | ||
})); | ||
return _deleteIframe.apply(this, arguments); | ||
} | ||
function iframeSize(options) { | ||
@@ -76,2 +120,7 @@ var iframeId = options.iframeId, | ||
var iframe = iframes[iframeId]; | ||
if (!iframe) { | ||
return; | ||
} | ||
var divId = iframe.divId, | ||
@@ -78,0 +127,0 @@ height = iframe.height, |
@@ -22,3 +22,4 @@ "use strict"; | ||
store.on("iframes.{iframeId}.refresh", _dfp.refreshDfpSlot); | ||
store.on("afterDelete", "iframes.{iframeId}", _dfp.destroyDfpSlot); | ||
store.on("afterDelete", "iframes.{iframeId}", _dfp.deleteDfpSlot); | ||
store.on("afterDelete", "iframes.{iframeId}", _iframes.deleteIframe); | ||
(0, _dfp.attachDfp)(store); | ||
@@ -25,0 +26,0 @@ return store; |
{ | ||
"name": "dot-store-iframe", | ||
"version": "2.6.3", | ||
"version": "2.6.7", | ||
"description": "Iframe controller integration for dot-store", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31393
398