From 29cbdbc54cb1de32214196e8949d53c35b63edb9 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Mon, 28 Jul 2014 13:43:19 -0400 Subject: [PATCH] Adding mobile menu Adding the arrowMenu css and js file and update Toolkit_Page for the correct menu for mobile. --- Toolkit/Page.php | 33 ++++++------ assets/dropper.gif | Bin 0 -> 534 bytes assets/dropper_2.gif | Bin 0 -> 537 bytes assets/dropper_3.gif | Bin 0 -> 526 bytes css/arrows.css | 112 ++++++++++++++++++++++++++++++++++++++++ libjs/arrowMenu.js | 75 +++++++++++++++++++++++++++ templates/template.html | 2 +- 7 files changed, 204 insertions(+), 18 deletions(-) create mode 100644 assets/dropper.gif create mode 100644 assets/dropper_2.gif create mode 100644 assets/dropper_3.gif create mode 100644 css/arrows.css create mode 100644 libjs/arrowMenu.js diff --git a/Toolkit/Page.php b/Toolkit/Page.php index fbce20e..20f3b32 100755 --- a/Toolkit/Page.php +++ b/Toolkit/Page.php @@ -145,22 +145,17 @@ class Toolkit_Page // Resources needed for every page. $GLOBALS['styleSheets'] = array(); + $GLOBALS['styleSheets'][] = $this->mediaBaseURL . 'css/arrows.css'; // Resources needed for every page. $GLOBALS['topScripts'][] = JQUERY_CDN_JS; $GLOBALS['topScripts'][] = MEDIA_BASE_URL . 'js/vendor/modernizr.js'; $GLOBALS['bottomScripts'][] = MEDIA_BASE_URL . 'js/foundation.min.js'; $GLOBALS['bottomScripts'][] = MEDIA_BASE_URL . 'js/foundation/foundation.offcanvas.js'; - + $GLOBALS['bottomScripts'][] = $this->mediaBaseURL . 'libjs/arrowMenu.js'; } private function _video() { - //$GLOBALS['styleSheets'][] - // = GLM_APP_BASE_URL . 'gallery/colorbox/colorbox.css'; - //$GLOBALS['bottomScripts'][] - // = GLM_APP_BASE_URL . 'libjs/plugins/colorbox/1.3.15/jquery.colorbox-min.js'; - //$GLOBALS['bottomScripts'][] - // = BASE_URL . 'Toolkit/Videos/libjs/thickbox.js'; $GLOBALS['bottomScripts'][] = BASE_URL . 'Toolkit/Videos/libjs/videos.js'; $dbh = Toolkit_Database::getInstance(); @@ -621,30 +616,34 @@ class Toolkit_Page } /** - * Returns page main navigation + * Returns mobile page navigation * * @param type $catid page catid * * @return type */ private function _getMainNav($catid) - { - $nav = $this->_navigationFactory->createMainNav(); - $mainNavArray = $nav->getNavStructure($this->_pageGateway, $catid); - - return $nav->renderPageNav($mainNavArray, 'tree'); - } - - private function _getArrayToListNav($catid) { $sideNav = new Toolkit_Template_Navigation_AllInOneSideNav( $this->_pageGateway ); $nav = $sideNav->getNavigation(); - $html = $this->_arrayToListHTML($nav, 0, "mainNav"); + $html = $this->_arrayToListHTML($nav); return ($html) ? $html : ''; } + /** + * _arrayToListHTML + * + * _arrayToListHTML is used for generating the mobile navigation + * menu that only appears on mobile sizes. + * + * @param type $array Navigation Array + * @param type $level Level of Ul starts at 0 + * @param type $className Class name for the main Ul + * + * @return string + */ private function _arrayToListHTML($array, $level = 0, $className = null) { static $tab = "\t", $format = '%s'; diff --git a/assets/dropper.gif b/assets/dropper.gif new file mode 100644 index 0000000000000000000000000000000000000000..2b65eacaa4c0f7ed429dd914209c3ce23e110650 GIT binary patch literal 534 zcmV+x0_punNk%w1VLSj(0M!5hLsVORhKlLw>Cw^Az{AC~xVlDGUHA9*p{cCj-``ni zZ_?G*?(Xi)%*<|ie*gdfgpHBpJ0+S}Xv`}>fXob~nfr>(EJzQ9#vYU}Oo zVQzCwT434P+2`ly|NsB;^78rl`QhQ=Mpj&M-%&%3+3zP`T2#l?V$jdFW`!^6Yc z+}*0It?TRS@$vEH<>gRaW8vcC(bCgHRb73EjnvfCZ+n2HsjKbn?cLqo&(F`Pt+7m7 zV!_45A^8LV2LS&7EC2ui06YLt000L6z?yJKEEHir!0-D9c`|4OV~L=GP?rw2CJMHsxM8Q?}HFEB06=0p-R9~$jODiHJc`1$(#{Qds_ z00RmfNU)&6g9sBUT*$DYLn-z4y^E(0ojP{&#PvE*Zk{%7r@on!Kw(-fYvu?b`xT5C zxLv(i1{?Ow6)ah`X5A_VN))LxZl+SL@-(T^B~6+*c`9@$QKLqW2Hi=KXV0HMfzYU7 Y<3^6x6m%Yn9ZR;X*|TWVCJX`qJ7NtH#sB~S literal 0 HcmV?d00001 diff --git a/assets/dropper_2.gif b/assets/dropper_2.gif new file mode 100644 index 0000000000000000000000000000000000000000..0f3fe266a3a407eb8c7debf7edffe98c18e61e16 GIT binary patch literal 537 zcmV+!0_OckNk%w1VLSj(0M!5hDmg%fjF0K*=`K7&&CtvBoS(6^xBL71_4W0^!NJ+u+H-q; zMNwC-v9mTqNoH+v?d|R7=jYei+Rx9=yS~5w|Nrvx@+9?B@$sOgr{(44zP`TM+1WZqOkQVfFg-(|qolpR!Q0#0p{1u@Xlwug z00000A^8LV2LS&7EC2ui06YLt000L6K!9*aEEz_u_P&_q2UF{ua)*+nwGs21Ty5HK+!&*wxomM88;8!7Ym`1$(#{Qds_ z00RmfNU)&6g9sBUT*$DYLn-z4!3!ZTU%GYe=8gM>z}&nW+`NH1XQKwSTi4E!P&O<= zvv9qBEgM!08Z23~Zq>@QE7YhqQm4EjSk>wiB}+9m<&d5DkB(bC%5+P=QN!^g?2 zv$pN;@ALEXTy1vQ+1XobbLHjbtgf$yl$z=3>3W5V(b3W0-``VaZ`IY+-QC^eJ@B3L6Hes0tnlpF$a;8ygn0v=$pEtwR_#3I-Mpz`zCtxkM}!vcU}& z8W+VwFbEXBv=k!GL;(W5s5RI{Egjqh-$p6oC(h+WFqRVQMk5FC^!4`l`1$(#{Qds_ z00RmfNU)&6g9sBUTqs2zzIFoM**m8oUA=JQ=xO72%3HZ;(`s2OcPv>jX5V)8`lW2x zvscJu)tYsySg28@P^DVcijpNOOq(`!`c&vpqDDv`MWSN|&!0Yi{scm!hE1HSaON=F Q%C)Q4uVBN9Ef@p 0) { + $(this).after(''); + } + }); +} + +function setNav() { + /* Close all. */ + $('#mobilenav ul ul').addClass('closed'); + + /* Find the current anchor. */ + var currentAnchor = $('#mobilenav ul').find('.current').eq(0); + /* Open all the current anchor's parents. */ + currentAnchor.parents('ul').removeClass('closed'); + currentAnchor.parents('ul').addClass('open'); + /* Open the current anchor's children. */ + if(currentAnchor.siblings('ul').length > 0) { + currentAnchor.siblings('ul').eq(0).removeClass('closed'); + currentAnchor.siblings('ul').eq(0).addClass('open'); + } +} + +$(function(){ + + setMobileNav(); + setNav(); +}) diff --git a/templates/template.html b/templates/template.html index 225f273..8838b1a 100755 --- a/templates/template.html +++ b/templates/template.html @@ -243,7 +243,7 @@ $(document).foundation({ offcanvas: { open_method: 'move', - close_on_click: true + close_on_click: false } }); -- 2.17.1