src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FloatPanel.min.js
changeset 557 bca7a7e058a3
equal deleted inserted replaced
-1:000000000000 557:bca7a7e058a3
       
     1 define("tinymce/ui/FloatPanel",["tinymce/ui/Panel","tinymce/ui/Movable","tinymce/ui/Resizable","tinymce/ui/DomUtils"],function(o,l,c,a){var i,d,b,p=[];var g=[],q;function m(){function r(t,s){while(t){if(t==s){return true}t=t.parent()}}if(!i){i=function(v){if(v.button==2){return}var u=p.length;while(u--){var t=p[u],s=t.getParentCtrl(v.target);if(t.settings.autohide){if(s){if(r(s,t)||t.parent()===s){continue}}v=t.fire("autohide",{target:v.target});if(!v.isDefaultPrevented()){t.hide()}}}};a.on(document,"click",i)}}function f(){if(!d){d=function(){var r;r=p.length;while(r--){h(p[r])}};a.on(window,"scroll",d)}}function e(){if(!b){var s=document.documentElement,t=s.clientWidth,r=s.clientHeight;b=function(){if(!document.all||t!=s.clientWidth||r!=s.clientHeight){t=s.clientWidth;r=s.clientHeight;j.hideAll()}};a.on(window,"resize",b)}}function h(r){var s=a.getViewPort().y;function t(x,u){var w;for(var v=0;v<p.length;v++){if(p[v]!=r){w=p[v].parent();while(w&&(w=w.parent())){if(w==r){p[v].fixed(x).moveBy(0,u).repaint()}}}}}if(r.settings.autofix){if(!r._fixed){r._autoFixY=r.layoutRect().y;if(r._autoFixY<s){r.fixed(true).layoutRect({y:0}).repaint();t(true,s-r._autoFixY)}}else{if(r._autoFixY>s){r.fixed(false).layoutRect({y:r._autoFixY}).repaint();t(false,r._autoFixY-s)}}}}function n(v,t){var r,w=j.zIndex||65535,s;if(v){g.push(t)}else{r=g.length;while(r--){if(g[r]===t){g.splice(r,1)}}}if(g.length){for(r=0;r<g.length;r++){if(g[r].modal){w++;s=g[r]}g[r].getEl().style.zIndex=w;g[r].zIndex=w;w++}}var u=document.getElementById(t.classPrefix+"modal-block");if(s){a.css(u,"z-index",s.zIndex-1)}else{if(u){u.parentNode.removeChild(u);q=false}}j.currentZIndex=w}var j=o.extend({Mixins:[l,c],init:function(s){var r=this;r._super(s);r._eventsRoot=r;r.addClass("floatpanel");if(s.autohide){m();e();p.push(r)}if(s.autofix){f();r.on("move",function(){h(this)})}r.on("postrender show",function(v){if(v.control==r){var u,t=r.classPrefix;if(r.modal&&!q){u=a.createFragment('<div id="'+t+'modal-block" class="'+t+"reset "+t+'fade"></div>');u=u.firstChild;r.getContainerElm().appendChild(u);setTimeout(function(){a.addClass(u,t+"in");a.addClass(r.getEl(),t+"in")},0);q=true}n(true,r)}});r.on("show",function(){r.parents().each(function(t){if(t._fixed){r.fixed(true);return false}})});if(s.popover){r._preBodyHtml='<div class="'+r.classPrefix+'arrow"></div>';r.addClass("popover").addClass("bottom").addClass(r.isRtl()?"end":"start")}},fixed:function(t){var s=this;if(s._fixed!=t){if(s._rendered){var r=a.getViewPort();if(t){s.layoutRect().y-=r.y}else{s.layoutRect().y+=r.y}}s.toggleClass("fixed",t);s._fixed=t}return s},show:function(){var r=this,s,t=r._super();s=p.length;while(s--){if(p[s]===r){break}}if(s===-1){p.push(r)}return t},hide:function(){k(this);n(false,this);return this._super()},hideAll:function(){j.hideAll()},close:function(){var r=this;if(!r.fire("close").isDefaultPrevented()){r.remove();n(false,r)}return r},remove:function(){k(this);this._super()},postRender:function(){var r=this;if(r.settings.bodyRole){this.getEl("body").setAttribute("role",r.settings.bodyRole)}return r._super()}});j.hideAll=function(){var s=p.length;while(s--){var r=p[s];if(r&&r.settings.autohide){r.hide();p.splice(s,1)}}};function k(r){var s;s=p.length;while(s--){if(p[s]===r){p.splice(s,1)}}s=g.length;while(s--){if(g[s]===r){g.splice(s,1)}}}return j});