@@ -288,9 +288,11 @@ protected function make_input( $name, $value ) {
288288 'crop-size-inputs ' ,
289289 );
290290
291- $ label = $ this ->get_part ( 'label ' );
292- $ label ['attributes ' ]['for ' ] = $ name ;
293- $ label ['content ' ] = __ ( 'Disable ' , 'cloudinary ' );
291+ // Disable toggle control.
292+ $ control = $ this ->get_part ( 'label ' );
293+ $ control ['attributes ' ]['class ' ][] = 'cld-input-on-off-control ' ;
294+ $ control ['attributes ' ]['class ' ][] = 'medium ' ;
295+ $ control ['attributes ' ]['for ' ] = $ name ;
294296
295297 $ check = $ this ->get_part ( 'input ' );
296298 $ check ['attributes ' ]['type ' ] = 'checkbox ' ;
@@ -303,6 +305,17 @@ protected function make_input( $name, $value ) {
303305 $ check ['attributes ' ]['checked ' ] = 'checked ' ;
304306 }
305307
308+ $ slider = $ this ->get_part ( 'span ' );
309+ $ slider ['attributes ' ]['class ' ][] = 'cld-input-on-off-control-slider ' ;
310+ $ slider ['render ' ] = true ;
311+
312+ $ control ['children ' ]['input ' ] = $ check ;
313+ $ control ['children ' ]['slider ' ] = $ slider ;
314+
315+ $ label = $ this ->get_part ( 'span ' );
316+ $ label ['attributes ' ]['class ' ] = 'cld-input-on-off-control-label ' ;
317+ $ label ['content ' ] = __ ( 'Disable ' , 'cloudinary ' );
318+
306319 $ input = $ this ->get_part ( 'input ' );
307320 $ input ['attributes ' ]['type ' ] = 'text ' ;
308321 $ input ['attributes ' ]['name ' ] = $ name ;
@@ -316,10 +329,10 @@ protected function make_input( $name, $value ) {
316329 $ clear_button ['attributes ' ]['title ' ] = __ ( 'Reset input ' , 'cloudinary ' );
317330 $ clear_button ['content ' ] = Utils::get_inline_svg ( 'css/images/undo.svg ' , false ) . '<span> ' . __ ( 'Reset ' , 'cloudinary ' ) . '</span> ' ;
318331
319- $ wrapper ['children ' ]['input ' ] = $ input ;
320- $ wrapper ['children ' ]['button ' ] = $ clear_button ;
321- $ wrapper ['children ' ]['label ' ] = $ label ;
322- $ wrapper ['children ' ]['check ' ] = $ check ;
332+ $ wrapper ['children ' ]['input ' ] = $ input ;
333+ $ wrapper ['children ' ]['button ' ] = $ clear_button ;
334+ $ wrapper ['children ' ]['control ' ] = $ control ;
335+ $ wrapper ['children ' ]['label ' ] = $ label ;
323336
324337 return $ wrapper ;
325338 }
0 commit comments