ionic-keyboard-assist
Version:
   {"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core")):"function"==typeof define&&define.amd?define("ionic-keyboard-assist",["exports","@angular/core"],t):t(e["ionic-keyboard-assist"]={},e.ng.core)}(this,function(e,t){"use strict";var n=function s(e){this.scrollPadding=!e||!e.scrollPadding||e.scrollPadding,this.scrollAssist=!e||!e.scrollAssist||e.scrollAssist},o=(i.prototype.init=function(e){e&&this.setOptions(e),this.addEventListeners()},i.prototype.setOptions=function(e){this.options=new n(e)},i.prototype.addEventListeners=function(){window.addEventListener("keyboardDidShow",this.onKeyboardDidShow),window.addEventListener("keyboardWillHide",this.onKeyboardWillHide)},i.prototype.removeEventListeners=function(){window.removeEventListener("keyboardDidShow",this.onKeyboardDidShow),window.removeEventListener("keyboardWillHide",this.onKeyboardWillHide)},i.prototype.getActivePageElement=function(){var e=document.getElementsByTagName("ion-router-outlet");if(e&&0<e.length){var t=e[e.length-1];return t&&t.lastElementChild?t.lastElementChild:null}return null},i.prototype.getActiveModalElement=function(){var e=document.getElementsByTagName("ion-app");if(e&&0<e.length){var t=e[e.length-1];return t&&t.lastElementChild&&"ION-MODAL"===t.lastElementChild.tagName?t.lastElementChild:null}return null},i.prototype.setPadding=function(e,t){void 0===t&&(t=0),e&&e.setAttribute("style","padding-bottom: "+t+"px !important")},i.prototype.scrollAssist=function(){document.activeElement&&"INPUT"===document.activeElement.tagName&&setTimeout(function(){return document.activeElement.scrollIntoView({block:"center",behavior:"smooth"})},100)},i.prototype.ngOnDestroy=function(){this.removeEventListeners()},i.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],i.ctorParameters=function(){return[]},i.ngInjectableDef=t.defineInjectable({factory:function(){return new i},token:i,providedIn:"root"}),i);function i(){var o=this;this.pages=[],this.onKeyboardDidShow=function(e){var t,n=o.getActiveModalElement();t=n||o.getActivePageElement(),o.pages.push(t),o.options.scrollPadding&&o.setPadding(t,e.keyboardHeight),o.options.scrollAssist&&o.scrollAssist()},this.onKeyboardWillHide=function(){o.pages.forEach(function(e){o.setPadding(e)}),setTimeout(function(){return o.pages=[]},50)},this.setOptions()}e.IonicKeyboardAssist=o,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=ionic-keyboard-assist.umd.min.js.map