@@ -425,7 +425,7 @@ function demo() {
425425 listTensorsBody += "style=\"padding: 0px; vertical-align: middle\">" ;
426426
427427 listTensorsBody += "<div class=\"format-selector\">" ;
428- listTensorsBody += "<div class=\"dropdown\" style=\"margin-top: 6px; margin-bottom: 6px\">" ;
428+ listTensorsBody += "<div class=\"dropdown format-dropdown \" style=\"margin-top: 6px; margin-bottom: 6px\">" ;
429429 listTensorsBody += "<div class=\"dropdown-trigger\">" ;
430430 listTensorsBody += "<button class=\"button has-text-spaced\" style=\"width: 190px\" " ;
431431 listTensorsBody += "aria-haspopup=\"true\" aria-controls=\"dropdown-menu\">" ;
@@ -465,7 +465,7 @@ function demo() {
465465 listTensorsBody += "<label class=\"label\" style=\"cursor: move; margin-bottom: 0px\">" ;
466466 listTensorsBody += "<small>Dimension " ;
467467 listTensorsBody += ( dim + 1 )
468- listTensorsBody += "</small></label><div class=\"dropdown\" data-val=\"" ;
468+ listTensorsBody += "</small></label><div class=\"dropdown format-dropdown \" data-val=\"" ;
469469 listTensorsBody += level ;
470470 listTensorsBody += "\" id=\"" ;
471471 listTensorsBody += selectId ;
@@ -485,14 +485,14 @@ function demo() {
485485 listTensorsBody += "<a data-val=\"d\" class=\"dropdown-item\">Dense</a>" ;
486486 listTensorsBody += "<hr class=\"dropdown-divider\">" ;
487487 listTensorsBody += "<a data-val=\"s\" class=\"dropdown-item\">" ;
488- listTensorsBody += "Compressed (w/ Unique Elements)</a>" ;
488+ listTensorsBody += "<div> Compressed</div><div> (w/ Unique Elements)</div> </a>" ;
489489 listTensorsBody += "<a data-val=\"u\" class=\"dropdown-item\">" ;
490- listTensorsBody += "Compressed (w/ Duplicate Elements)</a>" ;
490+ listTensorsBody += "<div> Compressed</div><div> (w/ Duplicate Elements)</div> </a>" ;
491491 listTensorsBody += "<hr class=\"dropdown-divider\">" ;
492492 listTensorsBody += "<a data-val=\"q\" class=\"dropdown-item\">" ;
493- listTensorsBody += "Singleton (w/ Unique Elements)</a>" ;
493+ listTensorsBody += "<div> Singleton</div><div> (w/ Unique Elements)</div> </a>" ;
494494 listTensorsBody += "<a data-val=\"c\" class=\"dropdown-item\">" ;
495- listTensorsBody += "Singleton (w/ Duplicate Elements)</a>" ;
495+ listTensorsBody += "<div> Singleton</div><div> (w/ Duplicate Elements)</div> </a>" ;
496496 listTensorsBody += "</div></div></div></div></li>" ;
497497 }
498498
@@ -588,12 +588,12 @@ function demo() {
588588 dropdown . removeClass ( 'is-active' ) ;
589589 } ) ;
590590
591- $ ( ".dropdown .button" ) . click ( function ( ) {
591+ $ ( ".format- dropdown .button" ) . click ( function ( ) {
592592 var dropdown = $ ( this ) . parents ( '.dropdown' ) ;
593593 dropdown . toggleClass ( 'is-active' ) ;
594594 } ) ;
595595
596- $ ( ".dropdown .button" ) . each ( function ( ) {
596+ $ ( ".format- dropdown .button" ) . each ( function ( ) {
597597 var dropdown = $ ( this ) . parents ( '.dropdown' ) ;
598598 document . addEventListener ( "click" , function ( ev ) {
599599 if ( ! dropdown [ 0 ] . contains ( ev . target ) ) {
@@ -1202,14 +1202,26 @@ function demo() {
12021202 for ( var e in examples ) {
12031203 listExamplesBody += "<li id=\"example_" ;
12041204 listExamplesBody += e ;
1205- listExamplesBody += "\" class=\"mdl-menu__item\">" ;
1205+ listExamplesBody += "\" class=\"mdl-menu__item\"><div class=\"short-name\">" ;
1206+ listExamplesBody += examples [ e ] . name ;
1207+ listExamplesBody += "</div><div class=\"long-name\">" ;
12061208 listExamplesBody += examples [ e ] . name ;
12071209 listExamplesBody += ": <code style=\"background-color: transparent\">" ;
12081210 listExamplesBody += examples [ e ] . code ;
1209- listExamplesBody += "</code></li>" ;
1211+ listExamplesBody += "</code></div></ li>" ;
12101212 }
12111213 $ ( "#listExamples" ) . html ( listExamplesBody ) ;
12121214
1215+ $ ( "#btnExamples" ) . click ( function ( ) {
1216+ if ( $ ( window ) . width ( ) > 480 ) {
1217+ $ ( "#listExamples .long-name" ) . css ( "display" , "block" ) ;
1218+ $ ( "#listExamples .short-name" ) . css ( "display" , "none" ) ;
1219+ } else {
1220+ $ ( "#listExamples .long-name" ) . css ( "display" , "none" ) ;
1221+ $ ( "#listExamples .short-name" ) . css ( "display" , "block" ) ;
1222+ }
1223+ } ) ;
1224+
12131225 var getURLParam = function ( k ) {
12141226 var url = window . location . search . substring ( 1 ) ;
12151227 var params = url . split ( '&' ) ;
0 commit comments