@@ -43,50 +43,6 @@ window.onclick = function (event) {
4343"use strict" ;
4444"use strict" ;
4545
46- var acc = document . getElementsByClassName ( "rh-accordion" ) ;
47- var i ;
48-
49- for ( i = 0 ; i < acc . length ; i ++ ) {
50- acc [ i ] . addEventListener ( "click" , function ( ) {
51- this . classList . toggle ( "rh-accordion-active" ) ;
52- var panel = this . nextElementSibling ;
53-
54- if ( panel . style . maxHeight ) {
55- panel . style . maxHeight = null ;
56- } else {
57- panel . style . maxHeight = panel . scrollHeight + 100 + "px" ;
58- }
59- } ) ;
60- }
61- "use strict" ;
62-
63- var videoPlayButton ,
64- videoWrapper = document . getElementsByClassName ( 'rh-video' ) [ 0 ] ,
65- video = document . getElementsByTagName ( 'video' ) [ 0 ] ,
66- videoMethods = {
67- renderVideoPlayButton : function renderVideoPlayButton ( ) {
68- if ( videoWrapper !== undefined && videoWrapper . contains ( video ) ) {
69- this . formatVideoPlayButton ( ) ;
70- video . classList . add ( 'has-media-controls-hidden' ) ;
71- videoPlayButton = document . getElementsByClassName ( 'video-button' ) [ 0 ] ;
72- videoPlayButton . addEventListener ( 'click' , this . hideVideoPlayButton ) ;
73- }
74- } ,
75- formatVideoPlayButton : function formatVideoPlayButton ( ) {
76- videoWrapper . insertAdjacentHTML ( 'beforeend' , '\
77- <div class="video-button"><div class="video-button-content"> <i class="feather icon-play"></i> </div></div>\
78- ' ) ;
79- } ,
80- hideVideoPlayButton : function hideVideoPlayButton ( ) {
81- video . play ( ) ;
82- videoPlayButton . classList . add ( 'is-hidden' ) ;
83- video . classList . remove ( 'has-media-controls-hidden' ) ;
84- video . setAttribute ( 'controls' , 'controls' ) ;
85- }
86- } ;
87- videoMethods . renderVideoPlayButton ( ) ;
88- "use strict" ;
89-
9046var acc = document . getElementsByClassName ( "rh-search-accordion" ) ;
9147var i ;
9248
@@ -196,4 +152,48 @@ function setShadow() {
196152 cols [ 0 ] . classList . add ( "rh-table-cell--shadow" ) ;
197153 }
198154 }
199- }
155+ }
156+ "use strict" ;
157+
158+ var acc = document . getElementsByClassName ( "rh-accordion" ) ;
159+ var i ;
160+
161+ for ( i = 0 ; i < acc . length ; i ++ ) {
162+ acc [ i ] . addEventListener ( "click" , function ( ) {
163+ this . classList . toggle ( "rh-accordion-active" ) ;
164+ var panel = this . nextElementSibling ;
165+
166+ if ( panel . style . maxHeight ) {
167+ panel . style . maxHeight = null ;
168+ } else {
169+ panel . style . maxHeight = panel . scrollHeight + 100 + "px" ;
170+ }
171+ } ) ;
172+ }
173+ "use strict" ;
174+
175+ var videoPlayButton ,
176+ videoWrapper = document . getElementsByClassName ( 'rh-video' ) [ 0 ] ,
177+ video = document . getElementsByTagName ( 'video' ) [ 0 ] ,
178+ videoMethods = {
179+ renderVideoPlayButton : function renderVideoPlayButton ( ) {
180+ if ( videoWrapper !== undefined && videoWrapper . contains ( video ) ) {
181+ this . formatVideoPlayButton ( ) ;
182+ video . classList . add ( 'has-media-controls-hidden' ) ;
183+ videoPlayButton = document . getElementsByClassName ( 'video-button' ) [ 0 ] ;
184+ videoPlayButton . addEventListener ( 'click' , this . hideVideoPlayButton ) ;
185+ }
186+ } ,
187+ formatVideoPlayButton : function formatVideoPlayButton ( ) {
188+ videoWrapper . insertAdjacentHTML ( 'beforeend' , '\
189+ <div class="video-button"><div class="video-button-content"> <i class="feather icon-play"></i> </div></div>\
190+ ' ) ;
191+ } ,
192+ hideVideoPlayButton : function hideVideoPlayButton ( ) {
193+ video . play ( ) ;
194+ videoPlayButton . classList . add ( 'is-hidden' ) ;
195+ video . classList . remove ( 'has-media-controls-hidden' ) ;
196+ video . setAttribute ( 'controls' , 'controls' ) ;
197+ }
198+ } ;
199+ videoMethods . renderVideoPlayButton ( ) ;
0 commit comments