Commit 22274f94631b51765859adcb07c6ad12d2ef985a
Exists in
master
Merge branch 'master' of http://gitlab.nologostudio.ru/alarionov/rekamore-su
Showing 1 changed file Side-by-side Diff
resources/views/education/show.blade.php
... | ... | @@ -9,17 +9,30 @@ |
9 | 9 | var this_li = $(this); |
10 | 10 | var thumb = this_li.find('.accordion-thumb'); |
11 | 11 | var parent_ul = this_li.closest('ul'); |
12 | + var panel = this_li.closest('.accordion-panel'); | |
13 | + var added_height = parseInt(panel.data('added-height')); | |
14 | + | |
15 | + if (isNaN(added_height)){ | |
16 | + added_height = 0; | |
17 | + } | |
12 | 18 | |
13 | 19 | parent_ul.find('.accordion-panel').hide(500); |
14 | 20 | |
15 | 21 | if (thumb.hasClass('ui-state-active')){ |
16 | - console.log(1000); | |
17 | 22 | thumb.removeClass('ui-state-active'); |
23 | + | |
24 | + var panel_height = panel.height() - parseInt(added_height); | |
25 | + panel.animate({height: panel_height + "px"}, 500 ); | |
26 | + panel.data('added-height', 0); | |
18 | 27 | } else { |
19 | - console.log(1001); | |
20 | 28 | parent_ul.find('.accordion-thumb').removeClass('ui-state-active'); |
21 | 29 | thumb.addClass('ui-state-active'); |
30 | + | |
31 | + var add_height = this_li.find('.accordion-panel').height(); | |
32 | + var panel_height = panel.height() + parseInt(add_height) - parseInt(added_height); | |
33 | + panel.animate({height: panel_height + "px"}, 500 ); | |
22 | 34 | this_li.find('.accordion-panel').show(500); |
35 | + panel.data('added-height', add_height); | |
23 | 36 | } |
24 | 37 | }); |
25 | 38 | }); |
... | ... | @@ -73,7 +86,7 @@ |
73 | 86 | @foreach($education_programs as $education_program) |
74 | 87 | <li class="accordion-item"> |
75 | 88 | <h3 class="accordion-thumb">{{$education_program['name']}}</h3> |
76 | - <div class="accordion-panel">{{$education_program['text']}}</div> | |
89 | + <div class="accordion-panel">{!!$education_program['text']!!}</div> | |
77 | 90 | </li> |
78 | 91 | @endforeach |
79 | 92 | </ul> |