Marius Cramer
2015-01-07 33712949277582a826eee5b6eeb95636caebd8a3
- Responsive menu improved
5 files modified
23 ■■■■ changed files
interface/web/themes/default/assets/javascripts/responsive.js 12 ●●●● patch | view | raw | blame | history
interface/web/themes/default/assets/javascripts/responsive.min.js 2 ●●● patch | view | raw | blame | history
interface/web/themes/default/assets/stylesheets/responsive.css 5 ●●●● patch | view | raw | blame | history
interface/web/themes/default/assets/stylesheets/responsive.min.css 2 ●●● patch | view | raw | blame | history
interface/web/themes/default/templates/sidenav.tpl.htm 2 ●●● patch | view | raw | blame | history
interface/web/themes/default/assets/javascripts/responsive.js
@@ -9,9 +9,11 @@
  // Hauptnavigation
  $('<ul />').appendTo($responsiveNavigation);
  var $addto = false;
  $($mainNavigation).find('a').each(function () {
    var $item = $(this);
    var $activeClass = $item.hasClass('active') ? ' class="active"' : '';
    var isactive = $activeClass != '' ? true : false;
    
    var capp = $item.attr('data-capp');
    if(capp) $activeClass += ' data-capp="' + capp + '"';
@@ -19,11 +21,14 @@
    capp = $item.attr('data-load-content');
    if(capp) $activeClass += ' data-load-content="' + capp + '"';
    $responsiveNavigation.find('ul').append($('<li><a href="' + $item.attr('href') + '"' + $activeClass + '><i class="icon ' + $item.data('icon-class') + '"></i>' + $item.text() + '</a></li>'));
    var $newel = $('<li><a href="' + $item.attr('href') + '"' + $activeClass + '><i class="icon ' + $item.data('icon-class') + '"></i>' + $item.text() + '</a></li>');
    if(isactive != '') $addto = $newel;
    $responsiveNavigation.find('ul').append($newel);
  });
  // Subnavigation
  $('<ul class="subnavi" />').appendTo($responsiveNavigation);
  if(!$addto) $addto = $responsiveNavigation;
  $('<ul class="subnavi" />').appendTo($addto);
  $($subNavigation).find('a').each(function () {
    var $item = $(this);
@@ -35,6 +40,9 @@
    capp = $item.attr('data-load-content');
    if(capp) addattr += ' data-load-content="' + capp + '"';
    capp = $item.hasClass('subnav-header');
    if(capp) addattr += ' class="subnav-header"';
    $responsiveNavigation.find('ul.subnavi').append($('<li><a href="' + $item.attr('href') + '"' + addattr + '>' + $item.text() + '</a></li>'));
  });
};
interface/web/themes/default/assets/javascripts/responsive.min.js
@@ -1 +1 @@
function loadPushyMenu(){var a=$("#main-navigation");var c=$("#sidebar");var b=$("nav.pushy");b.html("");$("<ul />").appendTo(b);$(a).find("a").each(function(){var d=$(this);var f=d.hasClass("active")?' class="active"':"";var e=d.attr("data-capp");if(e){f+=' data-capp="'+e+'"'}e=d.attr("data-load-content");if(e){f+=' data-load-content="'+e+'"'}b.find("ul").append($('<li><a href="'+d.attr("href")+'"'+f+'><i class="icon '+d.data("icon-class")+'"></i>'+d.text()+"</a></li>"))});$('<ul class="subnavi" />').appendTo(b);$(c).find("a").each(function(){var d=$(this);var e="";var f=d.attr("data-capp");if(f){e+=' data-capp="'+f+'"'}f=d.attr("data-load-content");if(f){e+=' data-load-content="'+f+'"'}b.find("ul.subnavi").append($('<li><a href="'+d.attr("href")+'"'+e+">"+d.text()+"</a></li>"))})};
function loadPushyMenu(){var a=$("#main-navigation");var d=$("#sidebar");var b=$("nav.pushy");b.html("");$("<ul />").appendTo(b);var c=false;$(a).find("a").each(function(){var e=$(this);var i=e.hasClass("active")?' class="active"':"";var g=i!=""?true:false;var h=e.attr("data-capp");if(h){i+=' data-capp="'+h+'"'}h=e.attr("data-load-content");if(h){i+=' data-load-content="'+h+'"'}var f=$('<li><a href="'+e.attr("href")+'"'+i+'><i class="icon '+e.data("icon-class")+'"></i>'+e.text()+"</a></li>");if(g!=""){c=f}b.find("ul").append(f)});if(!c){c=b}$('<ul class="subnavi" />').appendTo(c);$(d).find("a").each(function(){var e=$(this);var f="";var g=e.attr("data-capp");if(g){f+=' data-capp="'+g+'"'}g=e.attr("data-load-content");if(g){f+=' data-load-content="'+g+'"'}g=e.hasClass("subnav-header");if(g){f+=' class="subnav-header"'}b.find("ul.subnavi").append($('<li><a href="'+e.attr("href")+'"'+f+">"+e.text()+"</a></li>"))})};
interface/web/themes/default/assets/stylesheets/responsive.css
@@ -7,7 +7,10 @@
  .pushy ul.subnavi li {
    font-size: 12px; }
    .pushy ul.subnavi li a {
      padding: 2px 10px; }
      padding: 2px 10px;
      font-weight: normal; }
    .pushy ul.subnavi li a.subnav-header {
      font-weight: bold; }
.pushy a {
  padding: 10px;
  transition: color ease 500ms; }
interface/web/themes/default/assets/stylesheets/responsive.min.css
@@ -1 +1 @@
html,body{height:100%}.pushy ul{padding-left:0;list-style:none}.pushy ul.subnavi li{font-size:12px}.pushy ul.subnavi li a{padding:2px 10px}.pushy a{padding:10px;transition:color ease 500ms}.pushy i{font-size:22px;vertical-align:sub}@media screen and (max-width:970px){#main-wrapper,#content,#sidebar{width:100%}#inner-wrapper{margin:0 10px}#sidebar.news-sidebar{margin-top:0}}@media screen and (max-width:860px){#main-navigation{display:block}#main-navigation a{float:left;display:block;margin-top:-1px;padding-top:6px;width:60px;height:50px;border-bottom:0;border-right-style:solid;border-right-width:1px;border-bottom-style:solid;border-bottom-width:1px}#main-navigation .icon{font-size:16px}#main-navigation .title{font-size:10px}#main-navigation .btn{border-radius:0}#main-navigation .btn:first-child{margin-left:-1px}}@media screen and (max-width:670px){#main-navigation,#sidebar{display:none}.menu-btn{display:block;margin-top:8px;margin-right:10px;font-size:30px}}@media screen and (max-width:600px){#headerbar{float:left;width:100%}#searchform{float:left;margin-top:0}#logout-button{margin-top:0;margin-left:0}#sidebar{margin-top:10px}.table,.table thead,.table tbody,.table tr,.table th,.table td{display:block}.table caption{width:100%}.table thead tr{position:absolute;top:-9999px;left:-9999px}.table tbody tr{border-top:0}.progress{width:100%}}@media screen and (max-width:350px){#searchform input{width:130px}}
html,body{height:100%}.pushy ul{padding-left:0;list-style:none}.pushy ul.subnavi li{font-size:12px}.pushy ul.subnavi li a{padding:2px 10px;font-weight:normal}.pushy ul.subnavi li a.subnav-header{font-weight:bold}.pushy a{padding:10px;transition:color ease 500ms}.pushy i{font-size:22px;vertical-align:sub}@media screen and (max-width:970px){#main-wrapper,#content,#sidebar{width:100%}#inner-wrapper{margin:0 10px}#sidebar.news-sidebar{margin-top:0}}@media screen and (max-width:860px){#main-navigation{display:block}#main-navigation a{float:left;display:block;margin-top:-1px;padding-top:6px;width:60px;height:50px;border-bottom:0;border-right-style:solid;border-right-width:1px;border-bottom-style:solid;border-bottom-width:1px}#main-navigation .icon{font-size:16px}#main-navigation .title{font-size:10px}#main-navigation .btn{border-radius:0}#main-navigation .btn:first-child{margin-left:-1px}}@media screen and (max-width:670px){#main-navigation,#sidebar{display:none}.menu-btn{display:block;margin-top:8px;margin-right:10px;font-size:30px}}@media screen and (max-width:600px){#headerbar{float:left;width:100%}#searchform{float:left;margin-top:0}#logout-button{margin-top:0;margin-left:0}#sidebar{margin-top:10px}.table,.table thead,.table tbody,.table tr,.table th,.table td{display:block}.table caption{width:100%}.table thead tr{position:absolute;top:-9999px;left:-9999px}.table tbody tr{border-top:0}.progress{width:100%}}@media screen and (max-width:350px){#searchform input{width:130px}}
interface/web/themes/default/templates/sidenav.tpl.htm
@@ -1,5 +1,5 @@
<tmpl_loop name="nav_left">
    <header><tmpl_if name="startpage"><a href="#" data-load-content="<tmpl_var name='startpage'>"></tmpl_if><tmpl_var name="title"><tmpl_if name="startpage"></a></tmpl_if></header>
    <header><tmpl_if name="startpage"><a href="#" class="subnav-header" data-load-content="<tmpl_var name='startpage'>"></tmpl_if><tmpl_var name="title"><tmpl_if name="startpage"></a></tmpl_if></header>
    <ul id="sub-navigation">
      <tmpl_loop name="items">
      <li<tmpl_if name="html_id"> id='<tmpl_var name="html_id">' </tmpl_if>>