//>>built
define("dijit/_editor/plugins/AlwaysShowToolbar","dojo/_base/declare dojo/dom-class dojo/dom-construct dojo/dom-geometry dojo/_base/lang dojo/on dojo/sniff dojo/_base/window ../_Plugin".split(" "),function(m,g,k,d,h,n,f,q,p){return m("dijit._editor.plugins.AlwaysShowToolbar",p,{_handleScroll:!0,setEditor:function(b){b.iframe&&(this.editor=b,b.onLoadDeferred.then(h.hitch(this,this.enable)))},enable:function(b){this._updateHeight();this.own(n(window,"scroll",h.hitch(this,"globalOnScrollHandler")),this.editor.on("NormalizedDisplayChanged",
h.hitch(this,"_updateHeight")));return b},_updateHeight:function(){var b=this.editor;if(b.isLoaded&&!b.height){var a=d.getMarginSize(b.editNode).h;f("opera")&&(a=b.editNode.scrollHeight);a||(a=d.getMarginSize(b.document.body).h);this._fixEnabled&&(a+=d.getMarginSize(this.editor.header).h);if(0!=a){if(7>=f("ie")&&this.editor.minHeight){var e=parseInt(this.editor.minHeight);a<e&&(a=e)}a!=this._lastHeight&&(this._lastHeight=a,d.setMarginBox(b.iframe,{h:this._lastHeight}))}}},_lastHeight:0,globalOnScrollHandler:function(){var b=
7>f("ie");if(this._handleScroll){var a=this.editor.header;this._scrollSetUp||(this._scrollSetUp=!0,this._scrollThreshold=d.position(a,!0).y);var e=d.docScroll(this.editor.ownerDocument).y,c=a.style;if(e>this._scrollThreshold&&e<this._scrollThreshold+this._lastHeight){if(!this._fixEnabled){var l=d.getMarginSize(a);this.editor.iframe.style.marginTop=l.h+"px";b?(c.left=d.position(a).x,this._IEOriginalPos=a.previousSibling?["after",a.previousSibling]:a.nextSibling?["before",a.nextSibling]:["last",a.parentNode],
this.editor.ownerDocumentBody.appendChild(a),g.add(a,"dijitIEFixedToolbar")):(c.position="fixed",c.top="0px");d.setMarginBox(a,{w:l.w});c.zIndex=2E3;this._fixEnabled=!0}b=this.height?parseInt(this.editor.height):this.editor._lastHeight;c.display=e>this._scrollThreshold+b?"none":""}else this._fixEnabled&&(this.editor.iframe.style.marginTop="",c.position="",c.top="",c.zIndex="",c.display="",b&&(c.left="",g.remove(a,"dijitIEFixedToolbar"),this._IEOriginalPos?(k.place(a,this._IEOriginalPos[1],this._IEOriginalPos[0]),
this._IEOriginalPos=null):k.place(a,this.editor.iframe,"before")),c.width="",this._fixEnabled=!1)}},destroy:function(){this._IEOriginalPos=null;this._handleScroll=!1;this.inherited(arguments);7>f("ie")&&g.remove(this.editor.header,"dijitIEFixedToolbar")}})});