Created
July 10, 2014 13:06
-
-
Save iamblue/b431c87f561d448c982a to your computer and use it in GitHub Desktop.
process
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const proccessFrameDirective = ($timeout)-> | |
| { | |
| retrict: \A | |
| templateUrl: "/views/layout/project/item/comment.html" | |
| link: (scope, elem, attr) !-> | |
| $timeout -> | |
| scope.commentarr.push elem[0]offsetHeight | |
| ,100 | |
| scope.steparr.push Number(attr.step) | |
| switch attr.step | |
| | \0 => | |
| scope.cstep = 0 | |
| scope.commentTitle = attr.steptitle | |
| scope.commentContent = attr.stepcontent | |
| scope.commentPicUrl = attr.steppicurl | |
| scope.created = attr.createdat | |
| | \1 => | |
| scope.cstep = 1 | |
| scope.targetvotenum = scope.vdata.targetVoteNum | |
| scope.nowvotenum = scope.vdata.nowVoteNum | |
| if scope.nowvotenum >= scope.targetvotenum | |
| scope.percentwidth = 100 | |
| else | |
| scope.percentwidth = Number (scope.nowvotenum / scope.targetvotenum)*100 | |
| scope.step1summaryTitle = attr.steptitle | |
| scope.step1summaryContent = attr.stepcontent | |
| # console.log attr.steponvotetime | |
| scope.stepdownvotetime = attr.stepdownvotetime | |
| scope.steponvotetime = attr.steponvotetime | |
| | \2 => | |
| scope.cstep = 3 | |
| scope.step3downvotetime = attr.stepdownvotetime | |
| scope.step3onvotetime = attr.steponvotetime | |
| scope.step3title = attr.steptitle | |
| scope.step3desc = attr.stepcontent | |
| | \3 => | |
| scope.cstep = 4 | |
| scope.step4downvotetime = attr.stepdownvotetime | |
| scope.step4onvotetime = attr.steponvotetime | |
| scope.step4title = attr.steptitle | |
| scope.step4desc = attr.stepcontent | |
| | \4 => | |
| scope.cstep = 5 | |
| scope.step5downvotetime = attr.stepdownvotetime | |
| scope.step5onvotetime = attr.steponvotetime | |
| scope.step5title = attr.steptitle | |
| scope.step5desc = attr.stepcontent | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment