Skip to content

Commit

Permalink
build: v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
phucbm committed Oct 16, 2023
1 parent b808aff commit 29ebb17
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 32 deletions.
33 changes: 18 additions & 15 deletions dist/easy-popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -186,22 +186,25 @@ html:not(.easy-popup-open) .easy-popup-master {
transform: scale(0.98) translate(0, 50px);
}
.easy-popup.ep-mobile-layout .easy-popup-overflow {
overflow: hidden;
display: flex;
}
.easy-popup.ep-mobile-layout .easy-popup-container {
padding: 0;
overflow: auto;
max-width: 100%;
height: var(--ep-mobile-height);
background: var(--ep-popup-bg);
}
.easy-popup.ep-mobile-layout .ep-close-button {
--ep-close-color: #000;
transform: none;
position: fixed;
top: var(--ep-top-empty-space);
overflow:hidden;
display:flex;
}
.easy-popup.ep-mobile-layout .easy-popup-container {
padding:0;
overflow:auto;
max-width:100%;
height:var(--ep-mobile-height);
background:var(--ep-popup-bg);
}
.easy-popup.ep-mobile-layout .ep-close-button:not(.for-mobile-layout) {
display:none;
}
.easy-popup.ep-mobile-layout .ep-close-button.for-mobile-layout {
--ep-close-color:#000;
position:absolute;
top:0;
transform:none;
}
}
/* prevent scroll */
.ep-prevent-scroll {
Expand Down
28 changes: 14 additions & 14 deletions dist/easy-popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class PiaEasyPopup{
let cookieName = context.options.cookieName;
cookieName = typeof cookieName === 'string' && cookieName.length > 0 ? cookieName : context.id;
this.key = 'easy-popup-' + stringToSlug(cookieName);
this.popupId = context.id;

// validate expires
this.piaOptions = {expires: piaValue};
Expand Down Expand Up @@ -131,6 +132,10 @@ class PiaEasyPopup{
updateVal(val){
Pia.update(this.key, val);
}

remove(){
Pia.remove(this.key);
}
}

/* harmony default export */ const pia_easy_popup = (PiaEasyPopup);
Expand Down Expand Up @@ -460,17 +465,6 @@ function initMobileLayout(context){
}
},
});

// create html
// const html = `<div class="ep-mobile-heading">
// <div class="ep-mobile-heading__inner">
// ${context.options.title ? `<div class="ep-mobile-heading__title">${context.options.title}</div>` : ''}
// <button class="${CLASSES.closeButton} for-mobile-layout" ${ATTRS.toggle}>${closeButtonInnerText}</button>
// </div>
// </div>`;

//context.overflow.insertAdjacentHTML('beforeend', html);

}

function initTheme(context){
Expand Down Expand Up @@ -505,12 +499,18 @@ function addCloseButton(context){
closeButtonInnerText = context.options.closeButtonInnerText;
}

let html = `<button class="${CLASSES.closeButton}" ${ATTRS.toggle}>
const getButtonHtml = (classes = CLASSES.closeButton, attr = ATTRS.toggle) => {
return `<button class="${classes}" ${attr}>
${closeButtonInnerText}
</button>`;
}

// insert html
context.inner.insertAdjacentHTML('beforeend', html);
context.inner.insertAdjacentHTML('beforeend', getButtonHtml());


// sticky mobile close button
context.container.insertAdjacentHTML('beforebegin', getButtonHtml(CLASSES.closeButton + ' for-mobile-layout'));
}
;// CONCATENATED MODULE: ./src/helpers.js

Expand Down Expand Up @@ -671,7 +671,7 @@ class Popup{

// in case attr is a number (will be skipped by onIsString)
const attrId = this.el.getAttribute(ATTRS.init);
if(!isNaN(attrId)){
if(attrId !== null && !isNaN(attrId)){
this.id = `${attrId}`;
this.idType = 'attr-id';

Expand Down
2 changes: 1 addition & 1 deletion dist/easy-popup.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 29ebb17

Please sign in to comment.