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

There is a newer version: 3.5.0
Show newest version
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.Object.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.Object.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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJ1dHRlcmZhY2VzLW92ZXJsYXkudHMiXSwibmFtZXMiOlsiQnV0dGVyRmFjZXMiLCJPdmVybGF5IiwiZGVsYXkiLCJpc1RyYW5zcGFyZW50QmxvY2tpbmdPdmVybGF5QWN0aXZlIiwic2VsZWN0b3IiLCJ0aGlzIiwiaXNIaWRpbmciLCJjb25zb2xlIiwibG9nIiwicHJvdG90eXBlIiwic2hvdyIsIl90aGlzIiwiJGVsZW1lbnRzVG9EaXNhYmx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ICAgIGxldCB1dWlkID0gQnV0dGVyRmFjZXMuR3VpZC5uZXdHdWlkKCk7XG5cbiAgICAgICAgICAgICAgICBsZXQgJG92ZXJsYXkgPSAkKFwiPGRpdiBjbGFzcz0nYnV0dGVyLWNvbXBvbmVudC1vdmVybGF5JyBkYXRhLW92ZXJsYXktdXVpZD0nXCIgKyB1dWlkICsgXCInPjxkaXYgY2xhc3M9J1wiICsgdGhpcy5jYWxjT3ZlcmxheVNwaW5uZXJDbGFzcygkZWxlbWVudFRvRGlzYWJsZSkgKyBcIic+PC9kaXY+PC9kaXY+XCIpO1xuXG4gICAgICAgICAgICAgICAgJGVsZW1lbnRUb0Rpc2FibGUuYXR0cihcImRhdGEtb3ZlcmxheS11dWlkXCIsIHV1aWQpO1xuXG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuc2VsZWN0b3IgPT09IFwiYm9keVwiKSB7XG4gICAgICAgICAgICAgICAgICAgICRvdmVybGF5LmFkZENsYXNzKFwib3ZlcmxheS1ib2R5XCIpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIFRPRE8gaWYgYmxvY2twYWdlIGlzIHRydWUgc2V0IGl0IHRvIG1heCBzaXplXG4gICAgICAgICAgICAgICAgICAgICRvdmVybGF5Lm9mZnNldCgkZWxlbWVudFRvRGlzYWJsZS5vZmZzZXQoKSlcbiAgICAgICAgICAgICAgICAgICAgICAgIC53aWR0aCgkZWxlbWVudFRvRGlzYWJsZS5vdXRlcldpZHRoKCkpXG4gICAgICAgICAgICAgICAgICAgICAgICAuaGVpZ2h0KCRlbGVtZW50VG9EaXNhYmxlLm91dGVySGVpZ2h0KCkpXG4gICAgICAgICAgICAgICAgICAgICAgICAuYWRkQ2xhc3MoXCJvdmVybGF5LWJvZHktY2hpbGRcIilcbiAgICAgICAgICAgICAgICAgICAgICAgIC5jc3Moe1wicG9zaXRpb25cIjogXCJhYnNvbHV0ZVwifSk7IC8vIElFIG92ZXJyaWRlcyBjc3MgcG9zaXRpb24gc28gc2V0IGl0IGhlcmVcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAkKFwiYm9keVwiKS5hcHBlbmQoJG92ZXJsYXkpO1xuXG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuaXNUcmFuc3BhcmVudEJsb2NraW5nT3ZlcmxheUFjdGl2ZSkge1xuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhcIkJ1dHRlckZhY2VzLk92ZXJsYXkuc2hvdyAtIGlzVHJhbnNwYXJlbnRCbG9ja2luZ092ZXJsYXlBY3RpdmUgaXMgdHJ1ZSwgc2hvd2luZyB0cmFuc3BhcmVudCBvdmVybGF5IGRpcmVjbHlcIik7XG4gICAgICAgICAgICAgICAgICAgICRvdmVybGF5LnNob3coKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB3aW5kb3cuc2V0VGltZW91dCgoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghdGhpcy5pc0hpZGluZyAmJiAhdGhpcy5pc1RyYW5zcGFyZW50QmxvY2tpbmdPdmVybGF5QWN0aXZlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhcIkJ1dHRlckZhY2VzLk92ZXJsYXkuc2hvdyAtIGRlZmVycmVkOiBpc1RyYW5zcGFyZW50QmxvY2tpbmdPdmVybGF5QWN0aXZlIGlzIGZhbHNlLCBzaG93aW5nIHRyYW5zcGFyZW50IG92ZXJsYXkgYWZ0ZXIgZGVsYXlcIik7XG4gICAgICAgICAgICAgICAgICAgICAgICAkb3ZlcmxheS5zaG93KCk7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBpZiAoIXRoaXMuaXNIaWRpbmcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKFwiQnV0dGVyRmFjZXMuT3ZlcmxheS5zaG93IC0gZGVmZXJyZWQ6IHN0YXJ0aW5nIGFuaW1hdGlvbiB0byBtYWtlIG92ZXJsYXkgaW50cmFuc3BhcmVudFwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICRvdmVybGF5XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLnN0b3AodHJ1ZSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYW5pbWF0ZSh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wYWNpdHk6IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAzMDAsICgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coXCJCdXR0ZXJGYWNlcy5PdmVybGF5LnNob3cgLSBkZWZlcnJlZDogYW5pbWF0aW9uIGVuZGVkIHRvIG1ha2Ugb3ZlcmxheSBpbnRyYW5zcGFyZW50XCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSwgdGhpcy5kZWxheSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIHB1YmxpYyBoaWRlKCkge1xuICAgICAgICAgICAgY29uc29sZS5sb2coXCJCdXR0ZXJGYWNlcy5PdmVybGF5LmhpZGUgLSBzdGFydGluZyBhbmltYXRpb24gdG8gbWFrZSBvdmVybGF5IHRyYW5zcGFyZW50XCIpO1xuXG4gICAgICAgICAgICBsZXQgJGVsZW1lbnRzVG9EaXNhYmxlID0gJCh0aGlzLnNlbGVjdG9yKTtcbiAgICAgICAgICAgIHRoaXMuaXNIaWRpbmcgPSB0cnVlO1xuXG4gICAgICAgICAgICBCdXR0ZXJGYWNlcy5PdmVybGF5LmZhZGVPdXREZXRhY2h0ZWRPdmVybGF5cygpO1xuXG4gICAgICAgICAgICAkZWxlbWVudHNUb0Rpc2FibGUuZWFjaCgoaW5kZXgsIGVsZW1lbnRUb0Rpc2FibGUp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biAgICAgICAgfVxuXG4gICAgICAgIHByaXZhdGUgc3RhdGljIGZhZGVPdXRBdHRhY2h0ZWRPdmVybGF5cygpIHtcbiAgICAgICAgICAgIC8vIHJlbW92ZSBiaW5kZWQgZWxlbWVudHNcbiAgICAgICAgICAgICQoXCIuYnV0dGVyLWNvbXBvbmVudC1vdmVybGF5XCIpLmVhY2goKGluZGV4LCBlbGVtZW50VG9DaGVjaykgPT4ge1xuICAgICAgICAgICAgICAgIGxldCAkb3ZlcmxheSA9ICQoZWxlbWVudFRvQ2hlY2spO1xuICAgICAgICAgICAgICAgIGxldCB1dWlkVG9DaGVjayA9ICQoZWxlbWVudFRvQ2hlY2spLmF0dHIoXCJkYXRhLW92ZXJsYXktdXVpZFwiKTtcbiAgICAgICAgICAgICAgICBsZXQgZWxlbWVudHMgPSAkKFwiW2RhdGEtb3ZlcmxheS11dWlkPVwiICsgdXVpZFRvQ2hlY2sgKyBcIl1cIik7XG4gICAgICAgICAgICAgICAgaWYgKGVsZW1lbnRzLmxlbmd0aCA+IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgQnV0dGVyRmFjZXMuT3ZlcmxheS5mYWRlT3V0T3ZlcmxheSgkb3ZlcmxheSk7XG5cbiAgICAgICAgICAgICAgICAgICAgZWxlbWVudHMuZWFjaCgoaW5kZXgsIGVsZW1lbnQpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCAkZWxlbWVudCA9ICQoZWxlbWVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAkZWxlbWVudC5yZW1vdmVBdHRyKFwiZGF0YS1vdmVybGF5LXV1aWRcIik7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgcHJpdmF0ZSBzdGF0aWMgZmFkZU91dE92ZXJsYXkoJG92ZXJsYXk6IGFueSkge1xuICAgICAgICAgICAgJG92ZXJsYXlcbiAgICAgICAgICAgICAgICAuc3RvcCh0cnVlKVxuICAgICAgICAgICAgICAgIC5hbmltYXRlKHtcbiAgICAgICAgICAgICAgICAgICAgb3BhY2l0eTogMFxuICAgICAgICAgICAgICAgIH0sIDMwMCwgKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAkb3ZlcmxheS5yZW1vdmUoKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coXCJCdXR0ZXJGYWNlcy5PdmVybGF5LmhpZGUgLSBhbmltYXRpb24gZW5kZWQgdG8gbWFrZSBvdmVybGF5IHRyYW5zcGFyZW50LCBPVkVSTEFZIFJFTU9WRURcIik7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICBwcml2YXRlIHN0YXRpYyBmaW5kT3ZlcmxheSh1dWlkOiBTdHJpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiAkKFwiYm9keSAuYnV0dGVyLWNvbXBvbmVudC1vdmVybGF5W2RhdGEtb3ZlcmxheS11dWlkPSdcIiArIHV1aWQgKyBcIiddXCIpO1xuICAgICAgICB9XG4gICAgfVxufSJdfQ==




© 2015 - 2024 Weber Informatics LLC | Privacy Policy