这行得通,但是有没有人建议以更简化/优雅的方式来写这个?:
if @mediaAddQueue[''+mid]['mediaType'] is 'photo' and
@mediaAddQueue[''+mid]['econ_status'] is 'loaded' and
@mediaAddQueue[''+mid]['medium_status'] is 'loaded' and
@mediaAddQueue[''+mid]['thumb_status'] is 'loaded' and
not @mediaAddQueue[''+mid]['targetEventRecord']?
@addMedia @mediaAddQueue[''+mid]['targetEventRecord'], mid, @mediaAddQueue[''+mid]['mediaType']
else if @mediaAddQueue[''+mid]['mediaType'] is 'video' and
@mediaAddQueue[''+mid]['video_status'] is 'loaded' and
not @mediaAddQueue[''+mid]['targetEventRecord']?
@addMedia @mediaAddQueue[''+mid]['targetEventRecord'], mid, @mediaAddQueue[''+mid]['mediaType']