javascript - sidebar is not collapsing when removing code -
i have following html i'm customizing sb-admin template -
http://startbootstrap.com/template-overviews/sb-admin-2/
index.html
<!doctype html> <html lang="en"> {% load static %} {% if user.is_authenticated %} <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>{% block title %}company dashboard{% endblock %}</title> <!-- bootstrap core css --> <link href="{% static "css/bootstrap.min.css" %}" rel="stylesheet"> <!-- metismenu css --> <link href="{% static "css/plugins/metismenu/metismenu.min.css" %}" rel="stylesheet"> <!-- custom css --> <link href="{% static "css/sb-admin-2.css" %}" rel="stylesheet"> <!-- custom fonts --> <link href="{% static "font-awesome/css/font-awesome.min.css" %}" rel="stylesheet" type="text/css"> <!-- html5 shim , respond.js ie8 support of html5 elements , media queries --> <!-- warning: respond.js doesn't work if view page via file:// --> <!--[if lt ie 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div id="wrapper"> <!-- navigation --> <nav class="navbar navbar-default navbar-fixed-top" role="navigation" style="margin-bottom: 0"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand page-scroll" href="/dashboard/">{{ user.customer.company }} dashboard</a> </div> <!-- /.navbar-header --> <ul class="nav navbar-top-links navbar-right"> <a>production date {% "js f y h:i" %} est</a> <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-envelope fa-fw"></i> <i class="fa fa-caret-down"></i> </a> <ul class="dropdown-menu dropdown-messages"> <li> <a href="#"> <div> <strong>john smith</strong> <span class="pull-right text-muted"> <em>yesterday</em> </span> </div> <div>lorem ipsum dolor sit amet, consectetur adipiscing elit. pellentesque eleifend...</div> </a> </li> <li class="divider"></li> <li> <a href="#"> <div> <strong>john smith</strong> <span class="pull-right text-muted"> <em>yesterday</em> </span> </div> <div>lorem ipsum dolor sit amet, consectetur adipiscing elit. pellentesque eleifend...</div> </a> </li> <li class="divider"></li> <li> <a href="#"> <div> <strong>john smith</strong> <span class="pull-right text-muted"> <em>yesterday</em> </span> </div> <div>lorem ipsum dolor sit amet, consectetur adipiscing elit. pellentesque eleifend...</div> </a> </li> <li class="divider"></li> <li> <a class="text-center" href="#"> <strong>read messages</strong> <i class="fa fa-angle-right"></i> </a> </li> </ul> <!-- /.dropdown-messages --> </li> <!-- /.dropdown --> <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-tasks fa-fw"></i> <i class="fa fa-caret-down"></i> </a> <ul class="dropdown-menu dropdown-tasks"> <li> <a href="#"> <div> <p> <strong>task 1</strong> <span class="pull-right text-muted">40% complete</span> </p> <div class="progress progress-striped active"> <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%"> <span class="sr-only">40% complete (success)</span> </div> </div> </div> </a> </li> <li class="divider"></li> <li> <a href="#"> <div> <p> <strong>task 2</strong> <span class="pull-right text-muted">20% complete</span> </p> <div class="progress progress-striped active"> <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%"> <span class="sr-only">20% complete</span> </div> </div> </div> </a> </li> <li class="divider"></li> <li> <a href="#"> <div> <p> <strong>task 3</strong> <span class="pull-right text-muted">60% complete</span> </p> <div class="progress progress-striped active"> <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%"> <span class="sr-only">60% complete (warning)</span> </div> </div> </div> </a> </li> <li class="divider"></li> <li> <a href="#"> <div> <p> <strong>task 4</strong> <span class="pull-right text-muted">80% complete</span> </p> <div class="progress progress-striped active"> <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%"> <span class="sr-only">80% complete (danger)</span> </div> </div> </div> </a> </li> <li class="divider"></li> <li> <a class="text-center" href="#"> <strong>see tasks</strong> <i class="fa fa-angle-right"></i> </a> </li> </ul> <!-- /.dropdown-tasks --> </li> <!-- /.dropdown --> <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-bell fa-fw"></i> <i class="fa fa-caret-down"></i> </a> <ul class="dropdown-menu dropdown-alerts"> <li> <a href="#"> <div> <i class="fa fa-comment fa-fw"></i> new comment <span class="pull-right text-muted small">4 minutes ago</span> </div> </a> </li> <li class="divider"></li> <li> <a href="#"> <div> <i class="fa fa-twitter fa-fw"></i> 3 new followers <span class="pull-right text-muted small">12 minutes ago</span> </div> </a> </li> <li class="divider"></li> <li> <a href="#"> <div> <i class="fa fa-envelope fa-fw"></i> message sent <span class="pull-right text-muted small">4 minutes ago</span> </div> </a> </li> <li class="divider"></li> <li> <a href="#"> <div> <i class="fa fa-tasks fa-fw"></i> new task <span class="pull-right text-muted small">4 minutes ago</span> </div> </a> </li> <li class="divider"></li> <li> <a href="#"> <div> <i class="fa fa-upload fa-fw"></i> server rebooted <span class="pull-right text-muted small">4 minutes ago</span> </div> </a> </li> <li class="divider"></li> <li> <a class="text-center" href="#"> <strong>see alerts</strong> <i class="fa fa-angle-right"></i> </a> </li> </ul> <!-- /.dropdown-alerts --> </li> <!-- /.dropdown --> <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href={% url 'dashboard_profile' %}><i class="fa fa-user fa-fw"></i> user profile</a> </li> <li><a href={% url 'dashboard_settings' %}><i class="fa fa-gear fa-fw"></i> settings</a> </li> <li class="divider"></li> <li><a href={% url 'index' %}><i class="fa fa-sign-out fa-fw"></i> logout</a> </li> </ul> <!-- /.dropdown-user --> </li> <!-- /.dropdown --> </ul> <!-- /.navbar-top-links --> <!-- sidebar left --> <div class="navbar-default sidebar" role="navigation"> <div class="sidebar-nav navbar-collapse"> <ul class="nav" id="side-menu"> <li class="sidebar-search"> <div class="input-group custom-search-form"> <input type="text" class="form-control" placeholder="search..."> <span class="input-group-btn"> <button class="btn btn-default" type="button"> <i class="fa fa-search"></i> </button> </span> </div> <!-- /input-group --> </li> {% if not user.admin %} <li> <a href={% url 'dashboard_admin' %}><i class="fa fa-home fa-fw"></i> admin</a> </li> {% endif %} <li> <a href="#"><i class="fa fa-th-list fa-fw"></i> files<span class="fa arrow"></span></a> <ul class="nav nav-second-level"> <li> <a href="files/index.html">vendors</a> </li> <li> <a href={% url 'request' %}> request</a> </li> </ul> <!-- /.nav-second-level --> </li> <li> <a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> analytics<span class="fa arrow"></span></a> <ul class="nav nav-second-level"> <li> <a href="files/index.html">reports</a> </li> <li> <a href="files/index.html">custom</a> </li> </ul> <!-- /.nav-second-level --> </li> <li> <a href="#"><i class="fa fa-book fa-fw"></i> documentation<span class="fa arrow"></span></a> <ul class="nav nav-second-level"> <li> <a href={% url 'faq' %}> faq</a> </li> <li> <a href={% url 'faq' %}> api</a> </li> </ul> <!-- /.nav-second-level --> </li> </ul> </div> <!-- /.sidebar-collapse --> </div> <!-- /.navbar-static-side --> </nav> <div id="page-wrapper"> <div class="row"> <div class="col-lg-12"> <h1 class="page-header">welcome {{ user.first_name }} </h1> </div> <!-- /.col-lg-12 --> </div> {% block content %}{% endblock %} <!-- /.row --> <div class="row"> <div class="col-lg-8"> <div class="panel panel-default"> <div class="panel-body"> <div id="morris-area-chart"></div> </div> </div> <!-- /.panel --> <div class="panel panel-default"> <!-- /.panel-heading --> <div class="panel-body"> <div class="row"> <div class="col-lg-4"> </div> <!-- /.col-lg-4 (nested) --> <div class="col-lg-8"> <div id="morris-bar-chart"></div> </div> <!-- /.col-lg-8 (nested) --> </div> <!-- /.row --> </div> <!-- /.panel-body --> </div> <!-- /.panel --> <div class="panel panel-default"> </div> <!-- /.panel --> </div> <!-- /.col-lg-8 --> <div class="col-lg-4"> <div class="panel panel-default"> <div class="panel-body"> <div id="morris-donut-chart"></div> </div> <!-- /.panel-body --> </div> </div> <!-- /.col-lg-4 --> </div> <!-- /.row --> </div> <!-- /#page-wrapper --> </div> <!-- /#wrapper --> <!-- jquery --> <script src="{% static "js/jquery.js" %}"></script> <!-- bootstrap core javascript --> <script src="{% static "js/bootstrap.min.js" %}"></script> <!-- metis menu plugin javascript --> <script src="{% static "js/plugins/metismenu/metismenu.min.js" %}"></script> <!-- morris charts javascript --> <script src="{% static "js/plugins/morris/raphael.min.js" %}"></script> <script src="{% static "js/plugins/morris/morris.min.js" %}"></script> <script src="{% static "js/plugins/morris/morris-data.js" %}"></script> <!-- custom theme javascript --> <script src="{% static "js/sb-admin-2.js" %}"></script> </body> </html> {% else %} page restricted! {% endif %}
as remove following line -
<div id="morris-donut-chart"></div>
the collapse on sidebar stops working. i'm @ loss in row forcing sidebar javascript stop loading.
Comments
Post a Comment