Commit 9ea3d66e79037ca97a27c78bf0b7f8d6aea708d7
1 parent
8eac15c1
fix 学生端预览只能播放一遍bug
Showing
4 changed files
with
39 additions
and
2 deletions
src/css/recording.css
src/js/gb.js
| ... | ... | @@ -996,8 +996,7 @@ $(function() { |
| 996 | 996 | } |
| 997 | 997 | }); |
| 998 | 998 | }else{ |
| 999 | - playCode(); | |
| 1000 | - GBCodePlayBack.editable(0) | |
| 999 | + $('.play-code').show(); | |
| 1001 | 1000 | } |
| 1002 | 1001 | |
| 1003 | 1002 | |
| ... | ... | @@ -1990,6 +1989,13 @@ $(function() { |
| 1990 | 1989 | .removeClass('glyphicon-pause'); |
| 1991 | 1990 | |
| 1992 | 1991 | $('#recordertab a:first').tab('show'); |
| 1992 | + if(_role == 1){ | |
| 1993 | + for (var i = 0; i < GBCodePlayBack.records.length; i++) { | |
| 1994 | + GBCodePlayBack.records[i].trigger = 0; | |
| 1995 | + } | |
| 1996 | + // playEnd(); | |
| 1997 | + } | |
| 1998 | + | |
| 1993 | 1999 | if(document.URL.indexOf('index.htm') >= 0) { |
| 1994 | 2000 | Hourglass.stopTimer(); |
| 1995 | 2001 | } |
| ... | ... | @@ -2029,6 +2035,12 @@ $(function() { |
| 2029 | 2035 | var $sliderpropress = $(".replayprogress"); |
| 2030 | 2036 | $sliderpropress.slider("option", "disabled", false); |
| 2031 | 2037 | $('#excerciselist .ineedautocodehelp').data('status', 0).attr('title', '播放').find('span').addClass('glyphicon-play-circle').removeClass('glyphicon-stop'); |
| 2038 | + if(_role == 1){ | |
| 2039 | + for (var i = 0; i < GBCodePlayBack.records.length; i++) { | |
| 2040 | + GBCodePlayBack.records[i].trigger = 0; | |
| 2041 | + } | |
| 2042 | + // playEnd(); | |
| 2043 | + } | |
| 2032 | 2044 | } |
| 2033 | 2045 | } |
| 2034 | 2046 | }, |
| ... | ... | @@ -2327,6 +2339,12 @@ $(function() { |
| 2327 | 2339 | runResult() |
| 2328 | 2340 | }); |
| 2329 | 2341 | |
| 2342 | + $('.play-code').click(function(){ | |
| 2343 | + playCode(); | |
| 2344 | + GBCodePlayBack.editable(0) | |
| 2345 | + // playEnd(); | |
| 2346 | + }); | |
| 2347 | + | |
| 2330 | 2348 | // 使用服务端编译语言 |
| 2331 | 2349 | $('#compileBtnGroup').unbind("click").on('click', '#CompileBtn', function(event){ |
| 2332 | 2350 | console.info('$(\'#compileBtnGroup\').unbind("click")') | ... | ... |
src/scss/recording.scss
src/v1.1/player.html
| ... | ... | @@ -166,7 +166,13 @@ |
| 166 | 166 | </div> |
| 167 | 167 | <div id="playFooter"> |
| 168 | 168 | <div class="" id="audioWrap"> |
| 169 | + <button class="play-code" style="display: none;"> | |
| 170 | + <i class="icon iconfont icon-play"></i> | |
| 171 | + </button> | |
| 169 | 172 | </div> |
| 173 | +<!-- <div class="playCode"> | |
| 174 | + <button>开始</button> | |
| 175 | + </div> --> | |
| 170 | 176 | </div> |
| 171 | 177 | </div> |
| 172 | 178 | <!-- --> | ... | ... |