MDL-32843 import YUI 3.5.1
[moodle.git] / lib / yui / 3.5.1 / build / shim-plugin / shim-plugin-min.js
blobc2aa45a3d42a9b979486de605424f8e1f3a3abc5
1 /*
2 YUI 3.5.1 (build 22)
3 Copyright 2012 Yahoo! Inc. All rights reserved.
4 Licensed under the BSD License.
5 http://yuilibrary.com/license/
6 */
7 YUI.add("shim-plugin",function(b){function a(c){this.init(c);}a.CLASS_NAME="yui-node-shim";a.TEMPLATE='<iframe class="'+a.CLASS_NAME+'" frameborder="0" title="Node Stacking Shim"'+'src="javascript:false" tabindex="-1" role="presentation"'+'style="position:absolute; z-index:-1;"></iframe>';a.prototype={init:function(c){this._host=c.host;this.initEvents();this.insert();this.sync();},initEvents:function(){this._resizeHandle=this._host.on("resize",this.sync,this);},getShim:function(){return this._shim||(this._shim=b.Node.create(a.TEMPLATE,this._host.get("ownerDocument")));},insert:function(){var c=this._host;this._shim=c.insertBefore(this.getShim(),c.get("firstChild"));},sync:function(){var d=this._shim,c=this._host;if(d){d.setAttrs({width:c.getStyle("width"),height:c.getStyle("height")});}},destroy:function(){var c=this._shim;if(c){c.remove(true);}this._resizeHandle.detach();}};a.NAME="Shim";a.NS="shim";b.namespace("Plugin");b.Plugin.Shim=a;},"3.5.1",{requires:["node-style","node-pluginhost"]});