File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -212,6 +212,15 @@ const createViewer = (
212
212
}
213
213
}
214
214
215
+ let shadowEnabled = true ;
216
+ publicAPI . setShadowEnabled = ( shadow ) => {
217
+ const toggleShadowButton = document . getElementById ( `${ viewerDOMId } -toggleShadowButton` ) ;
218
+ if ( shadow && ! shadowEnabled || ! shadow && shadowEnabled ) {
219
+ shadowEnabled = ! shadowEnabled ;
220
+ toggleShadowButton . click ( ) ;
221
+ }
222
+ }
223
+
215
224
publicAPI . captureImage = ( ) => {
216
225
return view . captureImage ( ) ;
217
226
}
Original file line number Diff line number Diff line change @@ -63,11 +63,11 @@ function createUseShadowToggle(
63
63
) ;
64
64
65
65
const useShadowButton = document . createElement ( 'div' ) ;
66
- useShadowButton . innerHTML = `<input id="${ viewerDOMId } -useShadow " type="checkbox" class="${
66
+ useShadowButton . innerHTML = `<input id="${ viewerDOMId } -toggleShadowButton " type="checkbox" class="${
67
67
style . toggleInput
68
68
} " checked><label class="${ contrastSensitiveStyle . shadowButton } ${
69
69
style . toggleButton
70
- } " for="${ viewerDOMId } -useShadow ">${ shadowIcon } </label>`;
70
+ } " for="${ viewerDOMId } -toggleShadowButton ">${ shadowIcon } </label>`;
71
71
let useShadow = true ;
72
72
useShadowButton . addEventListener ( 'change' , ( event ) => {
73
73
useShadow = ! useShadow ;
You can’t perform that action at this time.
0 commit comments