1 line
1.4 KiB
JavaScript
1 line
1.4 KiB
JavaScript
"use strict";var e=function(e){return e&&e.__esModule?e["default"]:e},t=e(require("react")),s=e(require("./keyframe-slot")),r=t.createClass({displayName:"LayerView",getInitialState:function(){var e=this;return this.props.animationModel.on("onpropertieschanged",function(){e.forceUpdate()}),{}},shouldComponentUpdate:function(e){return this.props.latestHash!==e.latestHash||this.props.totalFrames!==e.totalFrames||"undefined"!=typeof e.upserted||"undefined"!=typeof e.selected},render:function(){for(var e={width:this.props.totalWidth,height:40,opacity:this.props.locked?.4:1},r=[],a=0,i=0;a<this.props.totalFrames;){var o=this.props.keyframesExceeded&&"Body"===this.props.type?this.props.keyframesExceeded[a]:!1,p=a%5===0,n=this.props.animationModel.keyframeSelection.isSelected(this.props.layerId,a),d=void 0;"undefined"!=typeof this.props.upserted&&this.props.upserted===a&&(d=this.props.upserted),i<this.props.keyframes.length&&this.props.keyframes[i].time===a?(r.push(t.createElement(s,{animationModel:this.props.animationModel,key:a,keyframeIndex:a,layerId:this.props.layerId,exists:!0,exceedsLimit:o,marker:p,selected:n,upserted:d})),i++):r.push(t.createElement(s,{animationModel:this.props.animationModel,key:a,keyframeIndex:a,layerId:this.props.layerId,exceedsLimit:o,marker:p,selected:n})),a++}return t.createElement("div",{style:e,className:"animation-channel"},t.createElement("div",{className:"animation-channel-keyframes"},r))}});module.exports=r; |