From 344fbb23571655ec363e0ebf1bd99e6d125cad3e Mon Sep 17 00:00:00 2001 From: Kevin Ross Date: Thu, 14 Jan 2016 20:59:54 -0600 Subject: [PATCH] add example toggler for dashboard --- docs/examples/dashboard/example.js | 21 ++++++++++++++++++++- docs/examples/dashboard/index.html | 9 ++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/docs/examples/dashboard/example.js b/docs/examples/dashboard/example.js index 9d8aac0e..2da9981a 100644 --- a/docs/examples/dashboard/example.js +++ b/docs/examples/dashboard/example.js @@ -23,5 +23,24 @@ function setDrawerPosition(position){ setDrawerPosition('mdb-' + position) }) }) - }, 10) + + // add a toggle for drawer visibility that shows anytime + $('#drawer-visibility').click(function(){ + var $container = $('.mdb-layout-container') + + // once clicked, just do away with responsive marker + $container.removeClass('mdb-drawer-open-md') + + var $icon = $(this).find('.material-icons') + if($icon.text() == 'visibility_off'){ + $container.removeClass('mdb-drawer-open') + $icon.text('visibility') + } + else { + $container.addClass('mdb-drawer-open') + $icon.text('visibility_off') + } + }) + + }, 100) })(); diff --git a/docs/examples/dashboard/index.html b/docs/examples/dashboard/index.html index 2ca69c04..ad8f8960 100644 --- a/docs/examples/dashboard/index.html +++ b/docs/examples/dashboard/index.html @@ -6,7 +6,6 @@ group: material-design -
@@ -32,6 +31,11 @@ group: material-design
+ + +