| Current Path : /home/emeraadmin/public_html/node_modules/jqGrid/js/minified/ |
| Current File : /home/emeraadmin/public_html/node_modules/jqGrid/js/minified/jqModal.js |
!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(a){"use strict";a.fn.jqm=function(e){var t={overlay:50,closeoverlay:!0,overlayClass:"jqmOverlay",closeClass:"jqmClose",trigger:".jqModal",ajax:u,ajaxText:"",target:u,modal:u,toTop:u,onShow:u,onHide:u,onLoad:u};return this.each(function(){if(this._jqm)return c[this._jqm].c=a.extend({},c[this._jqm].c,e);o++,this._jqm=o,c[o]={c:a.extend(t,a.jqm.params,e),a:u,w:a(this).addClass("jqmID"+o),s:o},t.trigger&&a(this).jqmAddTrigger(t.trigger)})},a.fn.jqmAddClose=function(e){return i(this,e,"jqmHide")},a.fn.jqmAddTrigger=function(e){return i(this,e,"jqmShow")},a.fn.jqmShow=function(e){return this.each(function(){a.jqm.open(this._jqm,e)})},a.fn.jqmHide=function(e){return this.each(function(){a.jqm.close(this._jqm,e)})},a.jqm={hash:{},open:function(e,t){var o=c[e],n=o.c,i="."+n.closeClass,s=0<(s=parseInt(o.w.css("z-index")))?s:3e3,r=a("<div></div>").css({height:"100%",width:"100%",position:"fixed",left:0,top:0,"z-index":s-1,opacity:n.overlay/100});return o.a||(o.t=t,o.a=!0,o.w.css("z-index",s),n.modal?(d[0]||setTimeout(function(){new f("bind")},1),d.push(e)):0<n.overlay?n.closeoverlay&&o.w.jqmAddClose(r):r=u,o.o=r?r.addClass(n.overlayClass).prependTo("body"):u,n.ajax?(s=n.target||o.w,e=n.ajax,s="string"==typeof s?a(s,o.w):a(s),e="@"===e.substr(0,1)?a(t).attr(e.substring(1)):e,s.html(n.ajaxText).load(e,function(){n.onLoad&&n.onLoad.call(this,o),i&&o.w.jqmAddClose(a(i,o.w)),h(o)})):i&&o.w.jqmAddClose(a(i,o.w)),n.toTop&&o.o&&o.w.before('<span id="jqmP'+o.w[0]._jqm+'"></span>').insertAfter(o.o),n.onShow?n.onShow(o):o.w.show(),h(o)),u},close:function(e){e=c[e];return e.a&&(e.a=u,d[0]&&(d.pop(),d[0]||new f("unbind")),e.c.toTop&&e.o&&a("#jqmP"+e.w[0]._jqm).after(e.w).remove(),e.c.onHide?e.c.onHide(e):(e.w.hide(),e.o&&e.o.remove())),u},params:{}};var o=0,c=a.jqm.hash,d=[],u=!1,h=function(e){void 0===e.c.focusField&&(e.c.focusField=0),0<=e.c.focusField&&t(e)},t=function(e){try{a(":input:visible",e.w)[parseInt(e.c.focusField,10)].focus()}catch(e){}},f=function(e){a(document)[e]("keypress",n)[e]("keydown",n)[e]("mousedown",n)},n=function(o){var e=c[d[d.length-1]],n=!a(o.target).parents(".jqmID"+e.s)[0];return n&&a(".jqmID"+e.s).each(function(){var e=a(this),t=e.offset();if(t.top<=o.pageY&&o.pageY<=t.top+e.height()&&t.left<=o.pageX&&o.pageX<=t.left+e.width())return n=!1}),!n},i=function(e,t,o){return e.each(function(){var e=this._jqm;a(t).each(function(){this[o]||(this[o]=[],a(this).click(function(){for(var e in{jqmShow:1,jqmHide:1})for(var t in this[e])c[this[e][t]]&&c[this[e][t]].w[e](this);return u})),this[o].push(e)})})}});