All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.butterfaces-dist-js.butterfaces-overlay.min.js Maven / Gradle / Ivy

var ButterFaces;!function(e){var t=function(){function t(e,t,a){void 0===e&&(e=500),void 0===t&&(t=!0),void 0===a&&(a="body"),this.isHiding=!0,this.delay=e,this.isTransparentBlockingOverlayActive=t,this.selector=a,console.log("ButterFaces.Overlay.constructor - creating overlay with delay is "+this.delay+", isTransparentBlockingOverlayActive is "+this.isTransparentBlockingOverlayActive+", selector is "+this.selector)}return t.prototype.show=function(){var t=this,a=$(this.selector);e.Overlay.fadeOutDetachtedOverlays(),a.each(function(a,r){var o=$(r);if(t.isHiding=!1,!e.ObjectStatics.isNullOrUndefined(o.attr("data-overlay-uuid"))){if(e.Overlay.findOverlay(o.attr("data-overlay-uuid")).length>0)return void console.log("ButterFaces.Overlay.show - overlay already existing. Skip showing overlay");o.removeAttr("data-overlay-uuid")}console.log("ButterFaces.Overlay.show - appending not displayed overlay to body");var n=e.Guid.newGuid(),i=$("
");o.attr("data-overlay-uuid",n),"body"===t.selector?i.addClass("overlay-body"):i.offset(o.offset()).width(o.outerWidth()).height(o.outerHeight()).addClass("overlay-body-child").css({position:"absolute"}),$("body").append(i),t.isTransparentBlockingOverlayActive&&(console.log("ButterFaces.Overlay.show - isTransparentBlockingOverlayActive is true, showing transparent overlay direcly"),i.show()),window.setTimeout(function(){t.isHiding||t.isTransparentBlockingOverlayActive||(console.log("ButterFaces.Overlay.show - deferred: isTransparentBlockingOverlayActive is false, showing transparent overlay after delay"),i.show()),t.isHiding||(console.log("ButterFaces.Overlay.show - deferred: starting animation to make overlay intransparent"),i.stop(!0).animate({opacity:1},300,function(){console.log("ButterFaces.Overlay.show - deferred: animation ended to make overlay intransparent")}))},t.delay)})},t.prototype.hide=function(){console.log("ButterFaces.Overlay.hide - starting animation to make overlay transparent");var t=$(this.selector);this.isHiding=!0,e.Overlay.fadeOutDetachtedOverlays(),t.each(function(t,a){var r=$(a),o=r.attr("data-overlay-uuid");if(!e.ObjectStatics.isNullOrUndefined(o)&&e.Overlay.findOverlay(o).length>0){var n=e.Overlay.findOverlay(r.attr("data-overlay-uuid"));e.Overlay.fadeOutOverlay(n)}})},t.prototype.calcOverlaySpinnerClass=function(e){return e.outerHeight()<55?"butter-component-spinner tiny":e.outerHeight()<105?"butter-component-spinner small":"butter-component-spinner"},t.hideAll=function(){console.log("ButterFaces.Overlay.hideAll - starting animation to make all overlays transparent"),e.Overlay.fadeOutDetachtedOverlays(),e.Overlay.fadeOutAttachtedOverlays()},t.fadeOutDetachtedOverlays=function(){$(".butter-component-overlay").each(function(t,a){var r=$(a),o=$(a).attr("data-overlay-uuid");1===$("[data-overlay-uuid="+o+"]").length&&e.Overlay.fadeOutOverlay(r)})},t.fadeOutAttachtedOverlays=function(){$(".butter-component-overlay").each(function(t,a){var r=$(a),o=$(a).attr("data-overlay-uuid"),n=$("[data-overlay-uuid="+o+"]");n.length>1&&(e.Overlay.fadeOutOverlay(r),n.each(function(e,t){$(t).removeAttr("data-overlay-uuid")}))})},t.fadeOutOverlay=function(e){e.stop(!0).animate({opacity:0},300,function(){e.remove(),console.log("ButterFaces.Overlay.hide - animation ended to make overlay transparent, OVERLAY REMOVED")})},t.findOverlay=function(e){return $("body .butter-component-overlay[data-overlay-uuid='"+e+"']")},t}();e.Overlay=t}(ButterFaces||(ButterFaces={})); //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJ1dHRlcmZhY2VzLW92ZXJsYXkudHMiXSwibmFtZXMiOlsiQnV0dGVyRmFjZXMiLCJPdmVybGF5IiwiZGVsYXkiLCJpc1RyYW5zcGFyZW50QmxvY2tpbmdPdmVybGF5QWN0aXZlIiwic2VsZWN0b3IiLCJ0aGlzIiwiaXNIaWRpbmciLCJjb25zb2xlIiwibG9nIiwicHJvdG90eXBlIiwic2hvdyIsIl90aGlzIiwiJGVsZW1lbnRzVG9EaXNhYmxlIiwiJCIsIm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91dERldGFjaHRlZE92ZXJsYXlzKCk7XG5cbiAgICAgICAgICAgICRlbGVtZW50c1RvRGlzYWJsZS5lYWNoKChpbmRleCwgZWxlbWVudFRvRGlzYWJsZSkgPT4ge1xuXG4gICAgICAgICAgICAgICAgbGV0ICRlbGVtZW50VG9EaXNhYmxlID0gJChlbGVtZW50VG9EaXNhYmxlKTtcblxuICAgICAgICAgICAgICAgIHRoaXMuaXNIaWRpbmcgPSBmYWxzZTtcblxuICAgICAgICAgICAgICAgIGlmICghQnV0dGVyRmFjZXMuT2JqZWN0U3RhdGljcy5pc051bGxPclVuZGVmaW5lZCgkZWxlbWVudFRvRGlzYWJsZS5hdHRyKFwiZGF0YS1vdmVybGF5LXV1aWRcIikpKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChCdXR0ZXJGYWNlcy5PdmVybGF5LmZpbmRPdmVybGF5KCRlbGVtZW50VG9EaXNhYmxlLmF0dHIoXCJkYXRhLW92ZXJsYXktdXVpZFwiKSkubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coXCJCdXR0ZXJGYWNlcy5PdmVybGF5LnNob3cgLSBvdmVybGF5IGFscmVhZHkgZXhpc3RpbmcuIFNraXAgc2hvd2luZyBvdmVybGF5XCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgJGVsZW1lbnRUb0Rpc2FibGUucmVtb3ZlQXR0cihcImRhdGEtb3ZlcmxheS11dWlkXCIpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgY29uc29sZS5sb2coXCJCdXR0ZXJGYWNlcy5PdmVybGF5LnNob3cgLSBhcHBlbmRpbmcgbm90IGRpc3BsYXllZCBvdmVybGF5IHRvIGJvZHlcIik7XG4gICAgICAgICAgICAgICAgbGV0IHV1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GVzIGNzcyBwb3NpdGlvbiBzbyBzZXQgaXQgaGVyZVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICQoXCJib2R5XCIpLmFwcGVuZCgkb3ZlcmxheSk7XG5cbiAgICAgICAgICAgICAgICBpZiAodGhpcy5pc1RyYW5zcGFyZW50QmxvY2tpbmdPdmVybGF5QWN0aXZlKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKFwiQnV0dGVyRmFjZXMuT3ZlcmxheS5zaG93IC0gaXNUcmFuc3BhcmVudEJsb2NraW5nT3ZlcmxheUFjdGl2ZSBpcyB0cnVlLCBzaG93aW5nIHRyYW5zcGFyZW50IG92ZXJsYXkgZGlyZWNseVwiKTtcbiAgICAgICAgICAgICAgICAgICAgJG92ZXJsYXkuc2hvdygpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHdpbmRvdy5zZXRUaW1lb3V0KCgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0aGlzLmlzSGlkaW5nICYmICF0aGlzLmlzVHJhbnNwYXJlbnRCbG9ja2luZ092ZXJsYXlBY3RpdmUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKFwiQnV0dGVyRmFjZXMuT3ZlcmxheS5zaG93IC0gZGVmZXJyZWQ6IGlzVHJhbnNwYXJlbnRCbG9ja2luZ092ZXJsYXlBY3RpdmUgaXMgZmFsc2UsIHNob3dpbmcgdHJhbnNwYXJlbnQgb3ZlcmxheSBhZnRlciBkZWxheVwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICRvdmVybGF5LnNob3coKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGlmICghdGhpcy5pc0hpZGluZykge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coXCJCdXR0ZXJGYWNlcy5PdmVybGF5LnNob3cgLSBkZWZlcnJlZDogc3RhcnRpbmcgYW5pbWF0aW9uIHRvIG1ha2Ugb3ZlcmxheSBpbnRyYW5zcGFyZW50XCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgJG92ZXJsYXlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc3RvcCh0cnVlKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hbmltYXRlKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3BhY2l0eTogMVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDMwMCwgKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhcIkJ1dHRlckZhY2VzLk92ZXJsYXkuc2hvdyAtIGRlZmVycmVkOiBhbmltYXRpb24gZW5kZWQgdG8gbWFrZSBvdmVybGF5IGludHJhbnNwYXJlbnRcIik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9LCB0aGlzLmRlbGF5KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgcHVibGljIGhpZGUoKSB7XG4gICAgICAgICAgICBjb25zb2xlLmxvZyhcIkJ1dHRlckZhY2VzLk92ZXJsYXkuaGlkZSAtIHN0YXJ0aW5nIGFuaW1hdGlvbiB0byBtYWtlIG92ZXJsYXkgdHJhbnNwYXJlbnRcIik7XG5cbiAgICAgICAgICAgIGxldCAkZWxlbWVudHNUb0Rpc2FibGUgPSAkKHRoaXMuc2VsZWN0b3IpO1xuICAgICAgICAgICAgdGhpcy5pc0hpZGluZyA9IHRydWU7XG5cbiAgICAgICAgICAgIEJ1dHRlckZhY2VzLk92ZXJsYXkuZmFkZU91dERldGFjaHRlZE92ZXJsYXlzKCk7XG5cbiAgICAgICAgICAgICRlbGVtZW50c1RvRGlzYWJsZS5lYWNoKChpbmRleCwgZWxlbWVudFRvRGlzYWJsZSkgPT4ge1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TtcbiAgICAgICAgfVxuXG4gICAgICAgIHByaXZhdGUgc3RhdGljIGZhZGVPdXRBdHRhY2h0ZWRPdmVybGF5cygpIHtcbiAgICAgICAgICAgIC8vIHJlbW92ZSBiaW5kZWQgZWxlbWVudHNcbiAgICAgICAgICAgICQoXCIuYnV0dGVyLWNvbXBvbmVudC1vdmVybGF5XCIpLmVhY2goKGluZGV4LCBlbGVtZW50VG9DaGVjaykgPT4ge1xuICAgICAgICAgICAgICAgIGxldCAkb3ZlcmxheSA9ICQoZWxlbWVudFRvQ2hlY2spO1xuICAgICAgICAgICAgICAgIGxldCB1dWlkVG9DaGVjayA9ICQoZWxlbWVudFRvQ2hlY2spLmF0dHIoXCJkYXRhLW92ZXJsYXktdXVpZFwiKTtcbiAgICAgICAgICAgICAgICBsZXQgZWxlbWVudHMgPSAkKFwiW2RhdGEtb3ZlcmxheS11dWlkPVwiICsgdXVpZFRvQ2hlY2sgKyBcIl1cIik7XG4gICAgICAgICAgICAgICAgaWYgKGVsZW1lbnRzLmxlbmd0aCA+IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgQnV0dGVyRmFjZXMuT3ZlcmxheS5mYWRlT3V0T3ZlcmxheSgkb3ZlcmxheSk7XG5cbiAgICAgICAgICAgICAgICAgICAgZWxlbWVudHMuZWFjaCgoaW5kZXgsIGVsZW1lbnQpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCAkZWxlbWVudCA9ICQoZWxlbWVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAkZWxlbWVudC5yZW1vdmVBdHRyKFwiZGF0YS1vdmVybGF5LXV1aWRcIik7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgcHJpdmF0ZSBzdGF0aWMgZmFkZU91dE92ZXJsYXkoJG92ZXJsYXk6IGFueSkge1xuICAgICAgICAgICAgJG92ZXJsYXlcbiAgICAgICAgICAgICAgICAuc3RvcCh0cnVlKVxuICAgICAgICAgICAgICAgIC5hbmltYXRlKHtcbiAgICAgICAgICAgICAgICAgICAgb3BhY2l0eTogMFxuICAgICAgICAgICAgICAgIH0sIDMwMCwgKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAkb3ZlcmxheS5yZW1vdmUoKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coXCJCdXR0ZXJGYWNlcy5PdmVybGF5LmhpZGUgLSBhbmltYXRpb24gZW5kZWQgdG8gbWFrZSBvdmVybGF5IHRyYW5zcGFyZW50LCBPVkVSTEFZIFJFTU9WRURcIik7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICBwcml2YXRlIHN0YXRpYyBmaW5kT3ZlcmxheSh1dWlkOiBTdHJpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiAkKFwiYm9keSAuYnV0dGVyLWNvbXBvbmVudC1vdmVybGF5W2RhdGEtb3ZlcmxheS11dWlkPSdcIiArIHV1aWQgKyBcIiddXCIpO1xuICAgICAgICB9XG4gICAgfVxufSJdfQ==




© 2015 - 2025 Weber Informatics LLC | Privacy Policy