{ "pandav:/index.js": { "cubeCode": "Cube('pandav:/com/full-screen/0.1.15',['pandav:/npm/bcore/0.0.18/event','pandav:/npm/jquery/2.1.4','pandav:/npm/lodash/4.6.1','pandav:/npm/screenfull/3.3.3'],function(a,b,c){var d=c('pandav:/npm/bcore/0.0.18/event'),e=c('pandav:/npm/jquery/2.1.4'),f=c('pandav:/npm/lodash/4.6.1'),g=c('pandav:/npm/screenfull/3.3.3');return a.exports=d.extend(function(a,b){this.config={alwaysShow:!1},this.container=e(a),this.apis=b.apis,this.init(b),this.full=!1},{init:function(a){var b=this;this.config=this.mergeConfig(a),this.container.append(e('
')),this.btn=this.container.find('.btn'),this.btn.append(''),this.img=this.container.find('.img'),this.updateStyle(this.config),this.btn.on('click',function(){g.enabled&&(g.isFullscreen?(g.exit(),b.full=!1,b.emit('exited')):(g.request(),b.full=!0,b.emit('entered')))}),this.btn.hover(function(){b.handleSrc(),b.config.alwaysShow||(b.btn.css({background:b.config.backgroundColor}),b.img.show())},function(){b.handleSrc(),b.config.alwaysShow||(b.btn.css({background:'transparent'}),b.img.hide())})},handleSrc:function(){this.full?this.config.exit?this.img.attr({src:this.config.exit}):this.img.removeAttr('src'):this.config.request?this.img.attr({src:this.config.request}):this.img.removeAttr('src')},updateOptions:function(a){a||(a=this.config);var b=this.mergeConfig(a);this.updateStyle(b)},updateStyle:function(a){var b=this.container.width(),c=this.container.height();this.btn.css({width:b,height:c,display:'flex',\"justify-content\":'center',\"align-items\":'center',\"border-radius\":a.borderRadius,\"user-select\":'none',background:a.alwaysShow?a.backgroundColor:'transparent',cursor:'pointer'}),this.img.css({width:.6*b,height:.6*c,\"user-select\":'none',display:a.alwaysShow?'block':'none'}),a.alwaysShow&&this.config.request?this.img.attr({src:this.config.request}):this.img.removeAttr('src')},mergeConfig:function(a){return a?(this.config=f.defaultsDeep(a||{},this.config),this.config):this.config},destroy:function(){this.container.empty(),this.btn.off(),this.img=null,this.btn=null,this.off()},enter:function(){if(g.enabled){if(g.isFullscreen)return;g.request(),this.full=!0,this.emit('entered')}},exit:function(){}}),a.exports});", "requires": [], "buildLevel": 1, "outputDir": "/com/full-screen/0.1.15", "outputPath": "/com/full-screen/0.1.15/index.js", "fileName": "/index.js" } }