jquery-slideoutpanel
Advanced tools
Comparing version 1.0.31 to 1.0.32
@@ -171,9 +171,12 @@ "use strict"; | ||
$('body').append(screenHtml); | ||
var touchScreen = document.getElementById("slide-out-panel-screen-".concat(elmId)); | ||
touchScreen.addEventListener('touchend', function (e) { | ||
e.preventDefault(); | ||
var closeBtnElemId = $(_this).attr('data-id'); | ||
closePanel(closeBtnElemId, globalSettings[closeBtnElemId], _this); | ||
return false; | ||
}, false); | ||
if (settings.screenClose) { | ||
var touchScreen = document.getElementById("slide-out-panel-screen-".concat(elmId)); | ||
touchScreen.addEventListener('touchend', function (e) { | ||
e.preventDefault(); | ||
var closeBtnElemId = $(_this).attr('data-id'); | ||
closePanel(closeBtnElemId, globalSettings[closeBtnElemId], _this); | ||
return false; | ||
}, false); | ||
} | ||
}; | ||
@@ -180,0 +183,0 @@ |
@@ -1,1 +0,1 @@ | ||
"use strict";function _slicedToArray(t,n){return _arrayWithHoles(t)||_iterableToArrayLimit(t,n)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function _iterableToArrayLimit(t,n){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var o=[],e=!0,i=!1,a=void 0;try{for(var s,r=t[Symbol.iterator]();!(e=(s=r.next()).done)&&(o.push(s.value),!n||o.length!==n);e=!0);}catch(t){i=!0,a=t}finally{try{e||null==r.return||r.return()}finally{if(i)throw a}}return o}}function _arrayWithHoles(t){if(Array.isArray(t))return t}!function(F,C){var w,x="SlideOutPanel",D={bodyPush:!1,breakpoint:"768px",closeBtn:"✕",closeBtnSize:"",enableEscapeKey:!1,offsetTop:0,screenClose:!0,screenOpacity:"0.5",screenZindex:"9998",showScreen:!0,slideFrom:"right",transition:"ease",transitionDuration:"0.35s",width:"350px",afterClosed:function(){},afterOpen:function(){},beforeClosed:function(){},beforeOpen:function(){},rendered:function(){}},T=!1;F.fn[x]=function(t){var a,e,i,s,r=this;if(void 0===F(this).attr("id"))return console.error("".concat(x,": Element not found. Element options:"),t),!1;function n(t,n){if(a=F("#".concat(t.id)),e=F("#".concat(t.id," header")),i=F("#".concat(t.id," section")),s=F("#".concat(t.id," footer")),a.hasClass("slide-out-panel")||a.addClass("slide-out-panel"),void 0===F(i).html())return y(t.id,"#".concat(t.id," <section> missing.")),!1;(w=w||{})[t.id]=t,w[t.id]=F.extend({},D,n);var o=w[t.id].transitionDuration;return o=o.replace("s",""),w[t.id].transitionDuration=parseFloat(o),g(),this._defaults=D,this._name=x,d(t.id,w[t.id]),!1}function c(t,n,o){var e,i,a="left"===n.slideFrom||"right"===n.slideFrom;if("open"===o)e="0";else{var s=n.width.match(/[a-zA-Z]+/),r=n.width.match(/(\d+)/);r=parseInt(r)+10,e=a?"-".concat(r).concat(s):"-100%"}return i=a?{left:"right"===n.slideFrom?"initial":e,right:"left"===n.slideFrom?"initial":e}:{top:"bottom"===n.slideFrom?"initial":e,bottom:"top"===n.slideFrom?"initial":e},"open"===o?F("#".concat(t)).addClass("open"):F("#".concat(t)).removeClass("open"),F("#".concat(t)).css(i),0}function o(t,n){var o=0<arguments.length&&void 0!==t&&t,e=1<arguments.length?n:void 0;return void 0===e?y(o,"#".concat(o," doesn't exist.")):(!e.bodyPush||"left"!==e.slideFrom&&"right"!==e.slideFrom||F("html").addClass("slide-out-".concat(e.slideFrom)),e.beforeOpen(),c(o,e,"open"),F("#slide-out-panel-screen-".concat(o)).addClass("open").css({opacity:1,transitionDuration:"".concat(e.transitionDuration,"s"),zIndex:"".concat(e.screenZindex)}),!e.bodyPush||"left"!==e.slideFrom&&"right"!==e.slideFrom||F("html").css({position:"absolute",width:"calc(".concat(F("body").width(),"px - ").concat(e.width)}),setTimeout(function(){e.afterOpen()},1e3*e.transitionDuration)),0}var l,d=function(t,n){return u(t,n),void 0!==F(e).html()&&h(t,n),f(t,n),p(),n.showScreen&&v(t,n),n.rendered(),!1},u=function(t,n){var o="left"===n.slideFrom||"right"===n.slideFrom;if(a.addClass("slide-out-panel-container ".concat(n.slideFrom)).css({display:"block",height:0===n.offsetTop?"initial":"calc(100vh - ".concat(n.offsetTop,")"),top:"bottom"===n.slideFrom?"initial":n.offsetTop,transitionTimingFunction:"".concat(n.transition),transitionDuration:"".concat(n.transitionDuration,"s"),width:n.width}).attr("data-id",t),n.bodyPush&&o&&F("html").css({transition:"width ".concat(n.transitionDuration,"s ").concat(n.transition)}),o){var e=n.width.match(/[a-zA-Z]+/),i=n.width.match(/(\d+)/);i=parseInt(i)+10,a.addClass("slide-out-panel-container ".concat(n.slideFrom)).css({left:"left"!==n.slideFrom?"initial":"-".concat(i).concat(e),right:"right"!==n.slideFrom?"initial":"-".concat(i).concat(e)})}else a.addClass("slide-out-panel-container ".concat(n.slideFrom)).css({bottom:"bottom"!==n.slideFrom?"initial":"-100%",top:"top"!==n.slideFrom?"initial":"-100%",width:"100vw"})},h=function(t,n){void 0!==e.html()&&e.addClass("slide-out-header").append(m(t,n))},f=function(t,n){i.addClass("slide-out-content"),void 0===e.html()&&i.append(m(t,n))},p=function(){s.addClass("slide-out-footer")},m=function(t,n){var o="";return o+='<span class="close-slide-out-panel" data-id="'.concat(t,'" ').concat(n.closeBtnSize?'style="font-size: '.concat(n.closeBtnSize,'; display: block;"'):"",">"),o+=n.closeBtn,o+="</span>"},v=function(t,n){var o="";o+="<div ",o+='id="slide-out-panel-screen-'.concat(t,'"'),o+='class="slide-out-panel-screen" ',o+='data-id="'.concat(t,'" '),o+='style="',o+="background-color: rgba(0, 0, 0, ".concat(n.screenOpacity,");"),o+="transition-timing-function: ".concat(n.transition,";"),o+="transition-duration: ".concat(n.transitionDuration,"s;"),o+="z-index: -".concat(n.screenZindex,";"),o+='">',o+="</div>",F("body").append(o),document.getElementById("slide-out-panel-screen-".concat(t)).addEventListener("touchend",function(t){t.preventDefault();var n=F(r).attr("data-id");return b(n,w[n],r),!1},!1)},b=function e(t,n,o){var i=0<arguments.length&&void 0!==t&&t,a=1<arguments.length&&void 0!==n&&n,s=2<arguments.length&&void 0!==o&&o;return void 0===a?y(i,"#".concat(i," doesn't exist.")):F(s).hasClass("slide-out-panel-screen")&&!a.screenClose||(i||a||s?(a.beforeClosed(),c(i,a,"close"),F("#slide-out-panel-screen-".concat(i)).removeClass("open").css({opacity:0,transitionDuration:"".concat(a.transitionDuration,"s")}),!a.bodyPush||"left"!==a.slideFrom&&"right"!==a.slideFrom||F("html").css({width:"100%"}),setTimeout(function(){F("#slide-out-panel-screen-".concat(i)).css({zIndex:"-9999"}),!a.bodyPush||"left"!==a.slideFrom&&"right"!==a.slideFrom||F("html").removeClass("slide-out-".concat(a.slideFrom)).css("position","initial"),a.afterClosed()},1e3*a.transitionDuration)):Object.entries(w).forEach(function(t){var n=_slicedToArray(t,2),o=n[0];n[1];w[o].enableEscapeKey&&e(o,w[o])})),!1},y=function(t,n){var o=1<arguments.length&&void 0!==n&&n;return F("#".concat(t,', .slide-out-panel-screen[data-id="').concat(t,'"]')).remove(),o&&console.error("".concat(x,": ").concat(o)),!1},g=function(){for(var t=F(C).width(),n=0;n<Object.values(w).length;n+=1){var o=Object.values(w)[n];if(t<o.breakpoint.match(/(\d+)/)[0]&&o.bodyPush){F("html").addClass("slide-out-panel-static");break}F("html").removeClass("slide-out-panel-static"),o.bodyPush&&F(".slide-out-panel-container.".concat(o.slideFrom)).hasClass("open")&&F("html").css({width:"calc(".concat(t,"px - ").concat(o.width)})}};return F(C).on("resize",function(t){clearTimeout(l),l=setTimeout(function(){g()},250)}),this.close=function(){var t=F(this).attr("id");b(t,w[t])},T||(F("body").on("click",".close-slide-out-panel, .slide-out-panel-screen",function(){var t=F(this).attr("data-id");return b(t,w[t],this),!1}),T=!0),F("body").on("keyup",function(t){27===t.keyCode&&b()}),this.destroy=function(){var t=F(r).attr("id");y(t)},this.open=function(){var t=F(this).attr("id");F("#".concat(t)).hasClass("open")||o(t,w[t])},this.toggle=function(){var t=F(this).attr("id");!function(t){var n=0<arguments.length&&void 0!==t&&t;(F("#".concat(n)).hasClass("open")?b:o)(n,w[n])}(t,w[t])},this.each(function(){F.data(this,"plugin-".concat(x,"-").concat(F(this).attr("id")),new n(this,t))})}}(jQuery,window); | ||
"use strict";function _slicedToArray(t,n){return _arrayWithHoles(t)||_iterableToArrayLimit(t,n)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function _iterableToArrayLimit(t,n){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var e=[],o=!0,i=!1,a=void 0;try{for(var s,r=t[Symbol.iterator]();!(o=(s=r.next()).done)&&(e.push(s.value),!n||e.length!==n);o=!0);}catch(t){i=!0,a=t}finally{try{o||null==r.return||r.return()}finally{if(i)throw a}}return e}}function _arrayWithHoles(t){if(Array.isArray(t))return t}!function(F,C){var w,x="SlideOutPanel",D={bodyPush:!1,breakpoint:"768px",closeBtn:"✕",closeBtnSize:"",enableEscapeKey:!1,offsetTop:0,screenClose:!0,screenOpacity:"0.5",screenZindex:"9998",showScreen:!0,slideFrom:"right",transition:"ease",transitionDuration:"0.35s",width:"350px",afterClosed:function(){},afterOpen:function(){},beforeClosed:function(){},beforeOpen:function(){},rendered:function(){}},T=!1;F.fn[x]=function(t){var a,o,i,s,r=this;if(void 0===F(this).attr("id"))return console.error("".concat(x,": Element not found. Element options:"),t),!1;function n(t,n){if(a=F("#".concat(t.id)),o=F("#".concat(t.id," header")),i=F("#".concat(t.id," section")),s=F("#".concat(t.id," footer")),a.hasClass("slide-out-panel")||a.addClass("slide-out-panel"),void 0===F(i).html())return y(t.id,"#".concat(t.id," <section> missing.")),!1;(w=w||{})[t.id]=t,w[t.id]=F.extend({},D,n);var e=w[t.id].transitionDuration;return e=e.replace("s",""),w[t.id].transitionDuration=parseFloat(e),g(),this._defaults=D,this._name=x,d(t.id,w[t.id]),!1}function c(t,n,e){var o,i,a="left"===n.slideFrom||"right"===n.slideFrom;if("open"===e)o="0";else{var s=n.width.match(/[a-zA-Z]+/),r=n.width.match(/(\d+)/);r=parseInt(r)+10,o=a?"-".concat(r).concat(s):"-100%"}return i=a?{left:"right"===n.slideFrom?"initial":o,right:"left"===n.slideFrom?"initial":o}:{top:"bottom"===n.slideFrom?"initial":o,bottom:"top"===n.slideFrom?"initial":o},"open"===e?F("#".concat(t)).addClass("open"):F("#".concat(t)).removeClass("open"),F("#".concat(t)).css(i),0}function e(t,n){var e=0<arguments.length&&void 0!==t&&t,o=1<arguments.length?n:void 0;return void 0===o?y(e,"#".concat(e," doesn't exist.")):(!o.bodyPush||"left"!==o.slideFrom&&"right"!==o.slideFrom||F("html").addClass("slide-out-".concat(o.slideFrom)),o.beforeOpen(),c(e,o,"open"),F("#slide-out-panel-screen-".concat(e)).addClass("open").css({opacity:1,transitionDuration:"".concat(o.transitionDuration,"s"),zIndex:"".concat(o.screenZindex)}),!o.bodyPush||"left"!==o.slideFrom&&"right"!==o.slideFrom||F("html").css({position:"absolute",width:"calc(".concat(F("body").width(),"px - ").concat(o.width)}),setTimeout(function(){o.afterOpen()},1e3*o.transitionDuration)),0}var l,d=function(t,n){return u(t,n),void 0!==F(o).html()&&h(t,n),f(t,n),p(),n.showScreen&&v(t,n),n.rendered(),!1},u=function(t,n){var e="left"===n.slideFrom||"right"===n.slideFrom;if(a.addClass("slide-out-panel-container ".concat(n.slideFrom)).css({display:"block",height:0===n.offsetTop?"initial":"calc(100vh - ".concat(n.offsetTop,")"),top:"bottom"===n.slideFrom?"initial":n.offsetTop,transitionTimingFunction:"".concat(n.transition),transitionDuration:"".concat(n.transitionDuration,"s"),width:n.width}).attr("data-id",t),n.bodyPush&&e&&F("html").css({transition:"width ".concat(n.transitionDuration,"s ").concat(n.transition)}),e){var o=n.width.match(/[a-zA-Z]+/),i=n.width.match(/(\d+)/);i=parseInt(i)+10,a.addClass("slide-out-panel-container ".concat(n.slideFrom)).css({left:"left"!==n.slideFrom?"initial":"-".concat(i).concat(o),right:"right"!==n.slideFrom?"initial":"-".concat(i).concat(o)})}else a.addClass("slide-out-panel-container ".concat(n.slideFrom)).css({bottom:"bottom"!==n.slideFrom?"initial":"-100%",top:"top"!==n.slideFrom?"initial":"-100%",width:"100vw"})},h=function(t,n){void 0!==o.html()&&o.addClass("slide-out-header").append(m(t,n))},f=function(t,n){i.addClass("slide-out-content"),void 0===o.html()&&i.append(m(t,n))},p=function(){s.addClass("slide-out-footer")},m=function(t,n){var e="";return e+='<span class="close-slide-out-panel" data-id="'.concat(t,'" ').concat(n.closeBtnSize?'style="font-size: '.concat(n.closeBtnSize,'; display: block;"'):"",">"),e+=n.closeBtn,e+="</span>"},v=function(t,n){var e="";e+="<div ",e+='id="slide-out-panel-screen-'.concat(t,'"'),e+='class="slide-out-panel-screen" ',e+='data-id="'.concat(t,'" '),e+='style="',e+="background-color: rgba(0, 0, 0, ".concat(n.screenOpacity,");"),e+="transition-timing-function: ".concat(n.transition,";"),e+="transition-duration: ".concat(n.transitionDuration,"s;"),e+="z-index: -".concat(n.screenZindex,";"),e+='">',e+="</div>",F("body").append(e),n.screenClose&&document.getElementById("slide-out-panel-screen-".concat(t)).addEventListener("touchend",function(t){t.preventDefault();var n=F(r).attr("data-id");return b(n,w[n],r),!1},!1)},b=function o(t,n,e){var i=0<arguments.length&&void 0!==t&&t,a=1<arguments.length&&void 0!==n&&n,s=2<arguments.length&&void 0!==e&&e;return void 0===a?y(i,"#".concat(i," doesn't exist.")):F(s).hasClass("slide-out-panel-screen")&&!a.screenClose||(i||a||s?(a.beforeClosed(),c(i,a,"close"),F("#slide-out-panel-screen-".concat(i)).removeClass("open").css({opacity:0,transitionDuration:"".concat(a.transitionDuration,"s")}),!a.bodyPush||"left"!==a.slideFrom&&"right"!==a.slideFrom||F("html").css({width:"100%"}),setTimeout(function(){F("#slide-out-panel-screen-".concat(i)).css({zIndex:"-9999"}),!a.bodyPush||"left"!==a.slideFrom&&"right"!==a.slideFrom||F("html").removeClass("slide-out-".concat(a.slideFrom)).css("position","initial"),a.afterClosed()},1e3*a.transitionDuration)):Object.entries(w).forEach(function(t){var n=_slicedToArray(t,2),e=n[0];n[1];w[e].enableEscapeKey&&o(e,w[e])})),!1},y=function(t,n){var e=1<arguments.length&&void 0!==n&&n;return F("#".concat(t,', .slide-out-panel-screen[data-id="').concat(t,'"]')).remove(),e&&console.error("".concat(x,": ").concat(e)),!1},g=function(){for(var t=F(C).width(),n=0;n<Object.values(w).length;n+=1){var e=Object.values(w)[n];if(t<e.breakpoint.match(/(\d+)/)[0]&&e.bodyPush){F("html").addClass("slide-out-panel-static");break}F("html").removeClass("slide-out-panel-static"),e.bodyPush&&F(".slide-out-panel-container.".concat(e.slideFrom)).hasClass("open")&&F("html").css({width:"calc(".concat(t,"px - ").concat(e.width)})}};return F(C).on("resize",function(t){clearTimeout(l),l=setTimeout(function(){g()},250)}),this.close=function(){var t=F(this).attr("id");b(t,w[t])},T||(F("body").on("click",".close-slide-out-panel, .slide-out-panel-screen",function(){var t=F(this).attr("data-id");return b(t,w[t],this),!1}),T=!0),F("body").on("keyup",function(t){27===t.keyCode&&b()}),this.destroy=function(){var t=F(r).attr("id");y(t)},this.open=function(){var t=F(this).attr("id");F("#".concat(t)).hasClass("open")||e(t,w[t])},this.toggle=function(){var t=F(this).attr("id");!function(t){var n=0<arguments.length&&void 0!==t&&t;(F("#".concat(n)).hasClass("open")?b:e)(n,w[n])}(t,w[t])},this.each(function(){F.data(this,"plugin-".concat(x,"-").concat(F(this).attr("id")),new n(this,t))})}}(jQuery,window); |
@@ -1,1 +0,1 @@ | ||
"use strict";function _slicedToArray(t,n){return _arrayWithHoles(t)||_iterableToArrayLimit(t,n)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function _iterableToArrayLimit(t,n){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var o=[],e=!0,i=!1,a=void 0;try{for(var s,r=t[Symbol.iterator]();!(e=(s=r.next()).done)&&(o.push(s.value),!n||o.length!==n);e=!0);}catch(t){i=!0,a=t}finally{try{e||null==r.return||r.return()}finally{if(i)throw a}}return o}}function _arrayWithHoles(t){if(Array.isArray(t))return t}!function(F,C){var w,x="SlideOutPanel",D={bodyPush:!1,breakpoint:"768px",closeBtn:"✕",closeBtnSize:"",enableEscapeKey:!1,offsetTop:0,screenClose:!0,screenOpacity:"0.5",screenZindex:"9998",showScreen:!0,slideFrom:"right",transition:"ease",transitionDuration:"0.35s",width:"350px",afterClosed:function(){},afterOpen:function(){},beforeClosed:function(){},beforeOpen:function(){},rendered:function(){}},T=!1;F.fn[x]=function(t){var a,e,i,s,r=this;if(void 0===F(this).attr("id"))return console.error("".concat(x,": Element not found. Element options:"),t),!1;function n(t,n){if(a=F("#".concat(t.id)),e=F("#".concat(t.id," header")),i=F("#".concat(t.id," section")),s=F("#".concat(t.id," footer")),a.hasClass("slide-out-panel")||a.addClass("slide-out-panel"),void 0===F(i).html())return y(t.id,"#".concat(t.id," <section> missing.")),!1;(w=w||{})[t.id]=t,w[t.id]=F.extend({},D,n);var o=w[t.id].transitionDuration;return o=o.replace("s",""),w[t.id].transitionDuration=parseFloat(o),g(),this._defaults=D,this._name=x,d(t.id,w[t.id]),!1}function c(t,n,o){var e,i,a="left"===n.slideFrom||"right"===n.slideFrom;if("open"===o)e="0";else{var s=n.width.match(/[a-zA-Z]+/),r=n.width.match(/(\d+)/);r=parseInt(r)+10,e=a?"-".concat(r).concat(s):"-100%"}return i=a?{left:"right"===n.slideFrom?"initial":e,right:"left"===n.slideFrom?"initial":e}:{top:"bottom"===n.slideFrom?"initial":e,bottom:"top"===n.slideFrom?"initial":e},"open"===o?F("#".concat(t)).addClass("open"):F("#".concat(t)).removeClass("open"),F("#".concat(t)).css(i),0}function o(t,n){var o=0<arguments.length&&void 0!==t&&t,e=1<arguments.length?n:void 0;return void 0===e?y(o,"#".concat(o," doesn't exist.")):(!e.bodyPush||"left"!==e.slideFrom&&"right"!==e.slideFrom||F("html").addClass("slide-out-".concat(e.slideFrom)),e.beforeOpen(),c(o,e,"open"),F("#slide-out-panel-screen-".concat(o)).addClass("open").css({opacity:1,transitionDuration:"".concat(e.transitionDuration,"s"),zIndex:"".concat(e.screenZindex)}),!e.bodyPush||"left"!==e.slideFrom&&"right"!==e.slideFrom||F("html").css({position:"absolute",width:"calc(".concat(F("body").width(),"px - ").concat(e.width)}),setTimeout(function(){e.afterOpen()},1e3*e.transitionDuration)),0}var l,d=function(t,n){return u(t,n),void 0!==F(e).html()&&h(t,n),f(t,n),p(),n.showScreen&&v(t,n),n.rendered(),!1},u=function(t,n){var o="left"===n.slideFrom||"right"===n.slideFrom;if(a.addClass("slide-out-panel-container ".concat(n.slideFrom)).css({display:"block",height:0===n.offsetTop?"initial":"calc(100vh - ".concat(n.offsetTop,")"),top:"bottom"===n.slideFrom?"initial":n.offsetTop,transitionTimingFunction:"".concat(n.transition),transitionDuration:"".concat(n.transitionDuration,"s"),width:n.width}).attr("data-id",t),n.bodyPush&&o&&F("html").css({transition:"width ".concat(n.transitionDuration,"s ").concat(n.transition)}),o){var e=n.width.match(/[a-zA-Z]+/),i=n.width.match(/(\d+)/);i=parseInt(i)+10,a.addClass("slide-out-panel-container ".concat(n.slideFrom)).css({left:"left"!==n.slideFrom?"initial":"-".concat(i).concat(e),right:"right"!==n.slideFrom?"initial":"-".concat(i).concat(e)})}else a.addClass("slide-out-panel-container ".concat(n.slideFrom)).css({bottom:"bottom"!==n.slideFrom?"initial":"-100%",top:"top"!==n.slideFrom?"initial":"-100%",width:"100vw"})},h=function(t,n){void 0!==e.html()&&e.addClass("slide-out-header").append(m(t,n))},f=function(t,n){i.addClass("slide-out-content"),void 0===e.html()&&i.append(m(t,n))},p=function(){s.addClass("slide-out-footer")},m=function(t,n){var o="";return o+='<span class="close-slide-out-panel" data-id="'.concat(t,'" ').concat(n.closeBtnSize?'style="font-size: '.concat(n.closeBtnSize,'; display: block;"'):"",">"),o+=n.closeBtn,o+="</span>"},v=function(t,n){var o="";o+="<div ",o+='id="slide-out-panel-screen-'.concat(t,'"'),o+='class="slide-out-panel-screen" ',o+='data-id="'.concat(t,'" '),o+='style="',o+="background-color: rgba(0, 0, 0, ".concat(n.screenOpacity,");"),o+="transition-timing-function: ".concat(n.transition,";"),o+="transition-duration: ".concat(n.transitionDuration,"s;"),o+="z-index: -".concat(n.screenZindex,";"),o+='">',o+="</div>",F("body").append(o),document.getElementById("slide-out-panel-screen-".concat(t)).addEventListener("touchend",function(t){t.preventDefault();var n=F(r).attr("data-id");return b(n,w[n],r),!1},!1)},b=function e(t,n,o){var i=0<arguments.length&&void 0!==t&&t,a=1<arguments.length&&void 0!==n&&n,s=2<arguments.length&&void 0!==o&&o;return void 0===a?y(i,"#".concat(i," doesn't exist.")):F(s).hasClass("slide-out-panel-screen")&&!a.screenClose||(i||a||s?(a.beforeClosed(),c(i,a,"close"),F("#slide-out-panel-screen-".concat(i)).removeClass("open").css({opacity:0,transitionDuration:"".concat(a.transitionDuration,"s")}),!a.bodyPush||"left"!==a.slideFrom&&"right"!==a.slideFrom||F("html").css({width:"100%"}),setTimeout(function(){F("#slide-out-panel-screen-".concat(i)).css({zIndex:"-9999"}),!a.bodyPush||"left"!==a.slideFrom&&"right"!==a.slideFrom||F("html").removeClass("slide-out-".concat(a.slideFrom)).css("position","initial"),a.afterClosed()},1e3*a.transitionDuration)):Object.entries(w).forEach(function(t){var n=_slicedToArray(t,2),o=n[0];n[1];w[o].enableEscapeKey&&e(o,w[o])})),!1},y=function(t,n){var o=1<arguments.length&&void 0!==n&&n;return F("#".concat(t,', .slide-out-panel-screen[data-id="').concat(t,'"]')).remove(),o&&console.error("".concat(x,": ").concat(o)),!1},g=function(){for(var t=F(C).width(),n=0;n<Object.values(w).length;n+=1){var o=Object.values(w)[n];if(t<o.breakpoint.match(/(\d+)/)[0]&&o.bodyPush){F("html").addClass("slide-out-panel-static");break}F("html").removeClass("slide-out-panel-static"),o.bodyPush&&F(".slide-out-panel-container.".concat(o.slideFrom)).hasClass("open")&&F("html").css({width:"calc(".concat(t,"px - ").concat(o.width)})}};return F(C).on("resize",function(t){clearTimeout(l),l=setTimeout(function(){g()},250)}),this.close=function(){var t=F(this).attr("id");b(t,w[t])},T||(F("body").on("click",".close-slide-out-panel, .slide-out-panel-screen",function(){var t=F(this).attr("data-id");return b(t,w[t],this),!1}),T=!0),F("body").on("keyup",function(t){27===t.keyCode&&b()}),this.destroy=function(){var t=F(r).attr("id");y(t)},this.open=function(){var t=F(this).attr("id");F("#".concat(t)).hasClass("open")||o(t,w[t])},this.toggle=function(){var t=F(this).attr("id");!function(t){var n=0<arguments.length&&void 0!==t&&t;(F("#".concat(n)).hasClass("open")?b:o)(n,w[n])}(t,w[t])},this.each(function(){F.data(this,"plugin-".concat(x,"-").concat(F(this).attr("id")),new n(this,t))})}}(jQuery,window); | ||
"use strict";function _slicedToArray(t,n){return _arrayWithHoles(t)||_iterableToArrayLimit(t,n)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function _iterableToArrayLimit(t,n){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var e=[],o=!0,i=!1,a=void 0;try{for(var s,r=t[Symbol.iterator]();!(o=(s=r.next()).done)&&(e.push(s.value),!n||e.length!==n);o=!0);}catch(t){i=!0,a=t}finally{try{o||null==r.return||r.return()}finally{if(i)throw a}}return e}}function _arrayWithHoles(t){if(Array.isArray(t))return t}!function(F,C){var w,x="SlideOutPanel",D={bodyPush:!1,breakpoint:"768px",closeBtn:"✕",closeBtnSize:"",enableEscapeKey:!1,offsetTop:0,screenClose:!0,screenOpacity:"0.5",screenZindex:"9998",showScreen:!0,slideFrom:"right",transition:"ease",transitionDuration:"0.35s",width:"350px",afterClosed:function(){},afterOpen:function(){},beforeClosed:function(){},beforeOpen:function(){},rendered:function(){}},T=!1;F.fn[x]=function(t){var a,o,i,s,r=this;if(void 0===F(this).attr("id"))return console.error("".concat(x,": Element not found. Element options:"),t),!1;function n(t,n){if(a=F("#".concat(t.id)),o=F("#".concat(t.id," header")),i=F("#".concat(t.id," section")),s=F("#".concat(t.id," footer")),a.hasClass("slide-out-panel")||a.addClass("slide-out-panel"),void 0===F(i).html())return y(t.id,"#".concat(t.id," <section> missing.")),!1;(w=w||{})[t.id]=t,w[t.id]=F.extend({},D,n);var e=w[t.id].transitionDuration;return e=e.replace("s",""),w[t.id].transitionDuration=parseFloat(e),g(),this._defaults=D,this._name=x,d(t.id,w[t.id]),!1}function c(t,n,e){var o,i,a="left"===n.slideFrom||"right"===n.slideFrom;if("open"===e)o="0";else{var s=n.width.match(/[a-zA-Z]+/),r=n.width.match(/(\d+)/);r=parseInt(r)+10,o=a?"-".concat(r).concat(s):"-100%"}return i=a?{left:"right"===n.slideFrom?"initial":o,right:"left"===n.slideFrom?"initial":o}:{top:"bottom"===n.slideFrom?"initial":o,bottom:"top"===n.slideFrom?"initial":o},"open"===e?F("#".concat(t)).addClass("open"):F("#".concat(t)).removeClass("open"),F("#".concat(t)).css(i),0}function e(t,n){var e=0<arguments.length&&void 0!==t&&t,o=1<arguments.length?n:void 0;return void 0===o?y(e,"#".concat(e," doesn't exist.")):(!o.bodyPush||"left"!==o.slideFrom&&"right"!==o.slideFrom||F("html").addClass("slide-out-".concat(o.slideFrom)),o.beforeOpen(),c(e,o,"open"),F("#slide-out-panel-screen-".concat(e)).addClass("open").css({opacity:1,transitionDuration:"".concat(o.transitionDuration,"s"),zIndex:"".concat(o.screenZindex)}),!o.bodyPush||"left"!==o.slideFrom&&"right"!==o.slideFrom||F("html").css({position:"absolute",width:"calc(".concat(F("body").width(),"px - ").concat(o.width)}),setTimeout(function(){o.afterOpen()},1e3*o.transitionDuration)),0}var l,d=function(t,n){return u(t,n),void 0!==F(o).html()&&h(t,n),f(t,n),p(),n.showScreen&&v(t,n),n.rendered(),!1},u=function(t,n){var e="left"===n.slideFrom||"right"===n.slideFrom;if(a.addClass("slide-out-panel-container ".concat(n.slideFrom)).css({display:"block",height:0===n.offsetTop?"initial":"calc(100vh - ".concat(n.offsetTop,")"),top:"bottom"===n.slideFrom?"initial":n.offsetTop,transitionTimingFunction:"".concat(n.transition),transitionDuration:"".concat(n.transitionDuration,"s"),width:n.width}).attr("data-id",t),n.bodyPush&&e&&F("html").css({transition:"width ".concat(n.transitionDuration,"s ").concat(n.transition)}),e){var o=n.width.match(/[a-zA-Z]+/),i=n.width.match(/(\d+)/);i=parseInt(i)+10,a.addClass("slide-out-panel-container ".concat(n.slideFrom)).css({left:"left"!==n.slideFrom?"initial":"-".concat(i).concat(o),right:"right"!==n.slideFrom?"initial":"-".concat(i).concat(o)})}else a.addClass("slide-out-panel-container ".concat(n.slideFrom)).css({bottom:"bottom"!==n.slideFrom?"initial":"-100%",top:"top"!==n.slideFrom?"initial":"-100%",width:"100vw"})},h=function(t,n){void 0!==o.html()&&o.addClass("slide-out-header").append(m(t,n))},f=function(t,n){i.addClass("slide-out-content"),void 0===o.html()&&i.append(m(t,n))},p=function(){s.addClass("slide-out-footer")},m=function(t,n){var e="";return e+='<span class="close-slide-out-panel" data-id="'.concat(t,'" ').concat(n.closeBtnSize?'style="font-size: '.concat(n.closeBtnSize,'; display: block;"'):"",">"),e+=n.closeBtn,e+="</span>"},v=function(t,n){var e="";e+="<div ",e+='id="slide-out-panel-screen-'.concat(t,'"'),e+='class="slide-out-panel-screen" ',e+='data-id="'.concat(t,'" '),e+='style="',e+="background-color: rgba(0, 0, 0, ".concat(n.screenOpacity,");"),e+="transition-timing-function: ".concat(n.transition,";"),e+="transition-duration: ".concat(n.transitionDuration,"s;"),e+="z-index: -".concat(n.screenZindex,";"),e+='">',e+="</div>",F("body").append(e),n.screenClose&&document.getElementById("slide-out-panel-screen-".concat(t)).addEventListener("touchend",function(t){t.preventDefault();var n=F(r).attr("data-id");return b(n,w[n],r),!1},!1)},b=function o(t,n,e){var i=0<arguments.length&&void 0!==t&&t,a=1<arguments.length&&void 0!==n&&n,s=2<arguments.length&&void 0!==e&&e;return void 0===a?y(i,"#".concat(i," doesn't exist.")):F(s).hasClass("slide-out-panel-screen")&&!a.screenClose||(i||a||s?(a.beforeClosed(),c(i,a,"close"),F("#slide-out-panel-screen-".concat(i)).removeClass("open").css({opacity:0,transitionDuration:"".concat(a.transitionDuration,"s")}),!a.bodyPush||"left"!==a.slideFrom&&"right"!==a.slideFrom||F("html").css({width:"100%"}),setTimeout(function(){F("#slide-out-panel-screen-".concat(i)).css({zIndex:"-9999"}),!a.bodyPush||"left"!==a.slideFrom&&"right"!==a.slideFrom||F("html").removeClass("slide-out-".concat(a.slideFrom)).css("position","initial"),a.afterClosed()},1e3*a.transitionDuration)):Object.entries(w).forEach(function(t){var n=_slicedToArray(t,2),e=n[0];n[1];w[e].enableEscapeKey&&o(e,w[e])})),!1},y=function(t,n){var e=1<arguments.length&&void 0!==n&&n;return F("#".concat(t,', .slide-out-panel-screen[data-id="').concat(t,'"]')).remove(),e&&console.error("".concat(x,": ").concat(e)),!1},g=function(){for(var t=F(C).width(),n=0;n<Object.values(w).length;n+=1){var e=Object.values(w)[n];if(t<e.breakpoint.match(/(\d+)/)[0]&&e.bodyPush){F("html").addClass("slide-out-panel-static");break}F("html").removeClass("slide-out-panel-static"),e.bodyPush&&F(".slide-out-panel-container.".concat(e.slideFrom)).hasClass("open")&&F("html").css({width:"calc(".concat(t,"px - ").concat(e.width)})}};return F(C).on("resize",function(t){clearTimeout(l),l=setTimeout(function(){g()},250)}),this.close=function(){var t=F(this).attr("id");b(t,w[t])},T||(F("body").on("click",".close-slide-out-panel, .slide-out-panel-screen",function(){var t=F(this).attr("data-id");return b(t,w[t],this),!1}),T=!0),F("body").on("keyup",function(t){27===t.keyCode&&b()}),this.destroy=function(){var t=F(r).attr("id");y(t)},this.open=function(){var t=F(this).attr("id");F("#".concat(t)).hasClass("open")||e(t,w[t])},this.toggle=function(){var t=F(this).attr("id");!function(t){var n=0<arguments.length&&void 0!==t&&t;(F("#".concat(n)).hasClass("open")?b:e)(n,w[n])}(t,w[t])},this.each(function(){F.data(this,"plugin-".concat(x,"-").concat(F(this).attr("id")),new n(this,t))})}}(jQuery,window); |
{ | ||
"name": "jquery-slideoutpanel", | ||
"version": "1.0.31", | ||
"version": "1.0.32", | ||
"description": "jQuery SlideOutPanel is a jQuery Plugin to add a sliding out panel.", | ||
@@ -5,0 +5,0 @@ "main": "Gruntfile.js", |
@@ -203,10 +203,13 @@ (function($, window) { | ||
const touchScreen = document.getElementById(`slide-out-panel-screen-${elmId}`); | ||
// Touch detection for mobile devices // | ||
if (settings.screenClose) { | ||
const touchScreen = document.getElementById(`slide-out-panel-screen-${elmId}`); | ||
touchScreen.addEventListener('touchend', e => { | ||
e.preventDefault(); | ||
const closeBtnElemId = $(this).attr('data-id'); | ||
closePanel(closeBtnElemId, globalSettings[closeBtnElemId], this); | ||
return false; | ||
}, false); | ||
touchScreen.addEventListener('touchend', e => { | ||
e.preventDefault(); | ||
const closeBtnElemId = $(this).attr('data-id'); | ||
closePanel(closeBtnElemId, globalSettings[closeBtnElemId], this); | ||
return false; | ||
}, false); | ||
} | ||
}; | ||
@@ -213,0 +216,0 @@ |
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
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
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
159059
1384