Skip to content

Commit 8546bb6

Browse files
committed
Resolve #132 Removal of deprecated methods
1 parent 2951e53 commit 8546bb6

4 files changed

Lines changed: 6 additions & 121 deletions

File tree

dist/smartbanner.js

Lines changed: 3 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,6 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
201201

202202
var DEFAULT_PLATFORMS = 'android,ios';
203203
var DEFAULT_CLOSE_LABEL = 'Close';
204-
var datas = {
205-
originalTop: 'data-smartbanner-original-top',
206-
originalMarginTop: 'data-smartbanner-original-margin-top'
207-
};
208204

209205
function handleExitClick(event, self) {
210206
self.exit();
@@ -226,34 +222,6 @@ function addEventListeners(self) {
226222
});
227223
}
228224

229-
function setContentPosition(value) {
230-
var wrappers = _detector["default"].wrapperElement();
231-
232-
for (var i = 0, l = wrappers.length, wrapper; i < l; i++) {
233-
wrapper = wrappers[i];
234-
235-
if (wrapper.getAttribute(datas.originalMarginTop)) {
236-
continue;
237-
}
238-
239-
var margin = parseFloat(getComputedStyle(wrapper).marginTop);
240-
wrapper.setAttribute(datas.originalMarginTop, isNaN(margin) ? 0 : margin);
241-
wrapper.style.marginTop = value + 'px';
242-
}
243-
}
244-
245-
function restoreContentPosition() {
246-
var wrappers = _detector["default"].wrapperElement();
247-
248-
for (var i = 0, l = wrappers.length, wrapper; i < l; i++) {
249-
wrapper = wrappers[i];
250-
251-
if (wrapper.getAttribute(datas.originalMarginTop)) {
252-
wrapper.style.marginTop = wrapper.getAttribute(datas.originalMarginTop) + 'px';
253-
}
254-
}
255-
}
256-
257225
var SmartBanner = /*#__PURE__*/function () {
258226
function SmartBanner() {
259227
_classCallCheck(this, SmartBanner);
@@ -263,8 +231,7 @@ var SmartBanner = /*#__PURE__*/function () {
263231
this.platform = _detector["default"].platform();
264232
var event = new Event('smartbanner.init');
265233
document.dispatchEvent(event);
266-
} // DEPRECATED. Will be removed.
267-
234+
}
268235

269236
_createClass(SmartBanner, [{
270237
key: "publish",
@@ -275,13 +242,12 @@ var SmartBanner = /*#__PURE__*/function () {
275242

276243
if (_bakery["default"].baked) {
277244
return false;
278-
} // User Agent was explicetely excluded by defined excludeUserAgentRegex
245+
} // User Agent was explicetely excluded by excludeUserAgentRegex
279246

280247

281248
if (this.userAgentExcluded) {
282249
return false;
283-
} // User agent was neither included by platformEnabled,
284-
// nor by defined includeUserAgentRegex
250+
} // User Agent was neither included by platformEnabled nor defined by includeUserAgentRegex
285251

286252

287253
if (!(this.platformEnabled || this.userAgentIncluded)) {
@@ -320,21 +286,6 @@ var SmartBanner = /*#__PURE__*/function () {
320286
var event = new Event('smartbanner.clickout');
321287
document.dispatchEvent(event);
322288
}
323-
}, {
324-
key: "originalTop",
325-
get: function get() {
326-
var wrapper = _detector["default"].wrapperElement()[0];
327-
328-
return parseFloat(wrapper.getAttribute(datas.originalTop));
329-
} // DEPRECATED. Will be removed.
330-
331-
}, {
332-
key: "originalTopMargin",
333-
get: function get() {
334-
var wrapper = _detector["default"].wrapperElement()[0];
335-
336-
return parseFloat(wrapper.getAttribute(datas.originalMarginTop));
337-
}
338289
}, {
339290
key: "priceSuffix",
340291
get: function get() {

0 commit comments

Comments
 (0)