$.widget("ui.containerNode",$.ui.sceneResource,{options:{data:null,parent:null,zoom:$.noop,onupdate:$.noop,ondelete:$.noop,addHistory:$.noop},category:"containers",isContainer:!0,defaultValues:{type:"",id:"",rotation:0,opacity:1,zIndex:0,position:{x:0,y:0},size:{width:200,height:200},fill:"",repeat:"no-repeat",hiddenAtStart:!1},sourceProp:["size","fill","repeat"],needToUpdateJson:!0,initElement:function(){var e=this;$.ui.sceneResource.prototype.initElement.apply(this,arguments);this.options.get("initDroppable",this.$inner,null,function(){return e.id()},function(e){return e})},initData:function(){$.ui.sceneResource.prototype.initData.apply(this,arguments);this.updateFill()},getRate:function(){var e=this.defaultValues.size;return e.width/e.height},fill:function(e){var t=this.elementData("fill",e);if(void 0===e)return t;this.updateFill();this.updatePreview()},repeat:function(e){var t=this.elementData("repeat",e);if(void 0===e)return t;this.updatePreview();return void 0},updateFill:function(){var e=this.fill();if($.utils.isColor(e)){this.$inner.css("background-image","");this.$inner.css("background-color",e)}else{this.$inner.css("background-color","");this.$inner.css("background-image","url('"+$.utils.getFileFullPath(e)+"?random="+$.utils.getRandom(1e3)+"')")}},updatePreview:function(e){function t(t){var n=t.width*e,r=t.height*e;"repeat"===o?i.css("background-size",n+"px "+r+"px"):"repeat-x"===o?i.css("background-size",n+"px 100%"):"repeat-y"===o&&i.css("background-size","100% "+r+"px")}e||(e=this.zoomValue);var i=this.$inner,n=this.size();i.css({width:n.width*e,height:n.height*e});var o=this.repeat()||"no-repeat",r=this.fill();"no-repeat"===o?i.css("background-size","100% 100%"):$.utils.isColor(r)?t(n):$.utils.getFileSize(r,t)},getObjectsParent:function(){return this.$inner}});