@@ -348,7 +348,6 @@ App.Views = {};
348
348
// create the TOC
349
349
this . scrollContent = document . getElementsByTagName ( 'body' ) [ 0 ] ;
350
350
351
- this . toggleCommonLangBlocks ( ) ;
352
351
353
352
// add toggles to code blocks if necessary
354
353
if ( this . platform === "ios" || this . platform === "osx" || this . platform === "macos" ) {
@@ -376,7 +375,7 @@ App.Views = {};
376
375
// calculate final position of headers for the TOC once
377
376
// the DOM is loaded (including images)
378
377
$ ( window ) . on ( 'load' , function ( ) {
379
- this . toc . updateHeights ( ) ;
378
+ this . toc && this . toc . updateHeights ( ) ;
380
379
} . bind ( this ) ) ;
381
380
382
381
$ ( function ( ) {
@@ -406,41 +405,6 @@ App.Views = {};
406
405
this . mobileToc . getElementsByTagName ( 'option' ) [ 0 ] . setAttribute ( 'selected' , true ) ;
407
406
} ,
408
407
409
- // in "common" sections, there's a code block for every platform,
410
- // this hides all but the current one
411
- toggleCommonLangBlocks : function ( ) {
412
- $ ( '.common-lang-block' ) . hide ( ) ;
413
- switch ( this . platform ) {
414
- case 'ios' :
415
- case 'osx' :
416
- case 'macos' :
417
- $ ( '.common-lang-block.objectivec' ) . show ( ) ;
418
- $ ( '.common-lang-block.swift' ) . show ( ) ;
419
- break ;
420
- case 'android' :
421
- $ ( '.common-lang-block.java' ) . show ( ) ;
422
- break ;
423
- case 'dotnet' :
424
- case 'unity' :
425
- $ ( '.common-lang-block.cs' ) . show ( ) ;
426
- break ;
427
- case 'php' :
428
- $ ( '.common-lang-block.php' ) . show ( ) ;
429
- break ;
430
- case 'rest' :
431
- $ ( '.common-lang-block.bash' ) . show ( ) ;
432
- $ ( '.common-lang-block.python' ) . show ( ) ;
433
- break ;
434
- case 'arduino' :
435
- $ ( '.common-lang-block.cpp' ) . show ( ) ;
436
- break ;
437
- case 'cloudcode' :
438
- case 'js' :
439
- default :
440
- $ ( '.common-lang-block.js' ) . show ( ) ;
441
- }
442
- } ,
443
-
444
408
setupServerFieldCustomization : function setupServerFieldCustomization ( ) {
445
409
446
410
if ( ! document . getElementById ( 'parse-server-custom-url' ) ) {
@@ -592,15 +556,15 @@ App.Views = {};
592
556
// we recalculate the header heights for the TOC
593
557
// highlighting when the height of the content changes
594
558
handleToggleChange : function ( ) {
595
- this . toc . updateHeights ( ) ;
559
+ this . toc && this . toc . updateHeights ( ) ;
596
560
} ,
597
561
598
562
handleSelectChange : function ( e ) {
599
563
location . href = this . mobileToc . selectedOptions [ 0 ] . getAttribute ( 'data-anchor' ) ;
600
564
} ,
601
565
602
566
handleWindowResize : function ( e ) {
603
- this . toc . updateHeights ( ) ;
567
+ this . toc && this . toc . updateHeights ( ) ;
604
568
}
605
569
} ;
606
570
0 commit comments