Merge branch 'menucollapse' of github.com:challgren/startbootstrap-sb-admin-2 into gh-pages

This commit is contained in:
Chris Hallgren
2014-12-24 22:54:31 -06:00
16 changed files with 112 additions and 46 deletions

View File

@@ -297,14 +297,14 @@
<li> <li>
<a href="forms.html"><i class="fa fa-edit fa-fw"></i> Forms</a> <a href="forms.html"><i class="fa fa-edit fa-fw"></i> Forms</a>
</li> </li>
<li class="active"> <li>
<a href="#"><i class="fa fa-wrench fa-fw"></i> UI Elements<span class="fa arrow"></span></a> <a href="#"><i class="fa fa-wrench fa-fw"></i> UI Elements<span class="fa arrow"></span></a>
<ul class="nav nav-second-level"> <ul class="nav nav-second-level">
<li> <li>
<a href="panels-wells.html">Panels and Wells</a> <a href="panels-wells.html">Panels and Wells</a>
</li> </li>
<li> <li>
<a class="active" href="buttons.html">Buttons</a> <a href="buttons.html">Buttons</a>
</li> </li>
<li> <li>
<a href="notifications.html">Notifications</a> <a href="notifications.html">Notifications</a>

View File

@@ -1,13 +1,14 @@
/* /*
* metismenu - v1.0.3 * metismenu - v1.1.3
* Easy menu jQuery plugin for Twitter Bootstrap 3 * Easy menu jQuery plugin for Twitter Bootstrap 3
* https://github.com/onokumus/metisMenu * https://github.com/onokumus/metisMenu
* *
* Made by Osman Nuri Okumuş * Made by Osman Nuri Okumus
* Under MIT License * Under MIT License
*/ */
.arrow { .arrow {
float: right; float: right;
line-height: 1.42857;
} }
.glyphicon.arrow:before { .glyphicon.arrow:before {

View File

@@ -1 +1,10 @@
.arrow{float:right}.glyphicon.arrow:before{content:"\e079"}.active>a>.glyphicon.arrow:before{content:"\e114"}.fa.arrow:before{content:"\f104"}.active>a>.fa.arrow:before{content:"\f107"}.plus-times{float:right}.fa.plus-times:before{content:"\f067"}.active>a>.fa.plus-times{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.plus-minus{float:right}.fa.plus-minus:before{content:"\f067"}.active>a>.fa.plus-minus:before{content:"\f068"} /*
* metismenu - v1.1.3
* Easy menu jQuery plugin for Twitter Bootstrap 3
* https://github.com/onokumus/metisMenu
*
* Made by Osman Nuri Okumus
* Under MIT License
*/
.arrow{float:right;line-height:1.42857}.glyphicon.arrow:before{content:"\e079"}.active>a>.glyphicon.arrow:before{content:"\e114"}.fa.arrow:before{content:"\f104"}.active>a>.fa.arrow:before{content:"\f107"}.plus-times{float:right}.fa.plus-times:before{content:"\f067"}.active>a>.fa.plus-times{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.plus-minus{float:right}.fa.plus-minus:before{content:"\f067"}.active>a>.fa.plus-minus:before{content:"\f068"}

View File

@@ -282,11 +282,11 @@
<li> <li>
<a href="index.html"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a> <a href="index.html"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
</li> </li>
<li class="active"> <li>
<a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> Charts<span class="fa arrow"></span></a> <a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> Charts<span class="fa arrow"></span></a>
<ul class="nav nav-second-level"> <ul class="nav nav-second-level">
<li> <li>
<a class="active" href="flot.html">Flot Charts</a> <a href="flot.html">Flot Charts</a>
</li> </li>
<li> <li>
<a href="morris.html">Morris.js Charts</a> <a href="morris.html">Morris.js Charts</a>

View File

@@ -292,7 +292,7 @@
<a href="tables.html"><i class="fa fa-table fa-fw"></i> Tables</a> <a href="tables.html"><i class="fa fa-table fa-fw"></i> Tables</a>
</li> </li>
<li> <li>
<a class="active" href="forms.html"><i class="fa fa-edit fa-fw"></i> Forms</a> <a href="forms.html"><i class="fa fa-edit fa-fw"></i> Forms</a>
</li> </li>
<li> <li>
<a href="#"><i class="fa fa-wrench fa-fw"></i> UI Elements<span class="fa arrow"></span></a> <a href="#"><i class="fa fa-wrench fa-fw"></i> UI Elements<span class="fa arrow"></span></a>

View File

@@ -294,7 +294,7 @@
<li> <li>
<a href="forms.html"><i class="fa fa-edit fa-fw"></i> Forms</a> <a href="forms.html"><i class="fa fa-edit fa-fw"></i> Forms</a>
</li> </li>
<li class="active"> <li>
<a href="#"><i class="fa fa-wrench fa-fw"></i> UI Elements<span class="fa arrow"></span></a> <a href="#"><i class="fa fa-wrench fa-fw"></i> UI Elements<span class="fa arrow"></span></a>
<ul class="nav nav-second-level"> <ul class="nav nav-second-level">
<li> <li>
@@ -313,7 +313,7 @@
<a href="icons.html"> Icons</a> <a href="icons.html"> Icons</a>
</li> </li>
<li> <li>
<a class="active" href="grid.html">Grid</a> <a href="grid.html">Grid</a>
</li> </li>
</ul> </ul>
<!-- /.nav-second-level --> <!-- /.nav-second-level -->

View File

@@ -294,7 +294,7 @@
<li> <li>
<a href="forms.html"><i class="fa fa-edit fa-fw"></i> Forms</a> <a href="forms.html"><i class="fa fa-edit fa-fw"></i> Forms</a>
</li> </li>
<li class="active"> <li>
<a href="#"><i class="fa fa-wrench fa-fw"></i> UI Elements<span class="fa arrow"></span></a> <a href="#"><i class="fa fa-wrench fa-fw"></i> UI Elements<span class="fa arrow"></span></a>
<ul class="nav nav-second-level"> <ul class="nav nav-second-level">
<li> <li>
@@ -310,7 +310,7 @@
<a href="typography.html">Typography</a> <a href="typography.html">Typography</a>
</li> </li>
<li> <li>
<a class="active" href="icons.html"> Icons</a> <a href="icons.html"> Icons</a>
</li> </li>
<li> <li>
<a href="grid.html">Grid</a> <a href="grid.html">Grid</a>

View File

@@ -280,7 +280,7 @@
<!-- /input-group --> <!-- /input-group -->
</li> </li>
<li> <li>
<a class="active" href="index.html"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a> <a href="index.html"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
</li> </li>
<li> <li>
<a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> Charts<span class="fa arrow"></span></a> <a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> Charts<span class="fa arrow"></span></a>
@@ -838,7 +838,7 @@
</span> </span>
<div class="chat-body clearfix"> <div class="chat-body clearfix">
<div class="header"> <div class="header">
<strong class="primary-font">Jack Sparrow</strong> <strong class="primary-font">Jack Sparrow</strong>
<small class="pull-right text-muted"> <small class="pull-right text-muted">
<i class="fa fa-clock-o fa-fw"></i> 12 mins ago <i class="fa fa-clock-o fa-fw"></i> 12 mins ago
</small> </small>
@@ -869,7 +869,7 @@
</span> </span>
<div class="chat-body clearfix"> <div class="chat-body clearfix">
<div class="header"> <div class="header">
<strong class="primary-font">Jack Sparrow</strong> <strong class="primary-font">Jack Sparrow</strong>
<small class="pull-right text-muted"> <small class="pull-right text-muted">
<i class="fa fa-clock-o fa-fw"></i> 14 mins ago</small> <i class="fa fa-clock-o fa-fw"></i> 14 mins ago</small>
</div> </div>

View File

@@ -1,20 +1,21 @@
/* /*
* metismenu - v1.0.3 * metismenu - v1.1.3
* Easy menu jQuery plugin for Twitter Bootstrap 3 * Easy menu jQuery plugin for Twitter Bootstrap 3
* https://github.com/onokumus/metisMenu * https://github.com/onokumus/metisMenu
* *
* Made by Osman Nuri Okumuş * Made by Osman Nuri Okumus
* Under MIT License * Under MIT License
*/ */
;(function ($, window, document, undefined) { ;(function($, window, document, undefined) {
var pluginName = "metisMenu", var pluginName = "metisMenu",
defaults = { defaults = {
toggle: true toggle: true,
doubleTapToGo: false
}; };
function Plugin(element, options) { function Plugin(element, options) {
this.element = element; this.element = $(element);
this.settings = $.extend({}, defaults, options); this.settings = $.extend({}, defaults, options);
this._defaults = defaults; this._defaults = defaults;
this._name = pluginName; this._name = pluginName;
@@ -22,10 +23,11 @@
} }
Plugin.prototype = { Plugin.prototype = {
init: function () { init: function() {
var $this = $(this.element), var $this = this.element,
$toggle = this.settings.toggle; $toggle = this.settings.toggle,
obj = this;
if (this.isIE() <= 9) { if (this.isIE() <= 9) {
$this.find("li.active").has("ul").children("ul").collapse("show"); $this.find("li.active").has("ul").children("ul").collapse("show");
@@ -35,18 +37,35 @@
$this.find("li").not(".active").has("ul").children("ul").addClass("collapse"); $this.find("li").not(".active").has("ul").children("ul").addClass("collapse");
} }
$this.find("li").has("ul").children("a").on("click", function (e) { //add the "doubleTapToGo" class to active items if needed
if (obj.settings.doubleTapToGo) {
$this.find("li.active").has("ul").children("a").addClass("doubleTapToGo");
}
$this.find("li").has("ul").children("a").on("click" + "." + pluginName, function(e) {
e.preventDefault(); e.preventDefault();
//Do we need to enable the double tap
if (obj.settings.doubleTapToGo) {
//if we hit a second time on the link and the href is valid, navigate to that url
if (obj.doubleTapToGo($(this)) && $(this).attr("href") !== "#" && $(this).attr("href") !== "") {
e.stopPropagation();
document.location = $(this).attr("href");
return;
}
}
$(this).parent("li").toggleClass("active").children("ul").collapse("toggle"); $(this).parent("li").toggleClass("active").children("ul").collapse("toggle");
if ($toggle) { if ($toggle) {
$(this).parent("li").siblings().removeClass("active").children("ul.in").collapse("hide"); $(this).parent("li").siblings().removeClass("active").children("ul.in").collapse("hide");
} }
}); });
}, },
isIE: function() {//https://gist.github.com/padolsey/527683 isIE: function() { //https://gist.github.com/padolsey/527683
var undef, var undef,
v = 3, v = 3,
div = document.createElement("div"), div = document.createElement("div"),
@@ -58,15 +77,44 @@
) { ) {
return v > 4 ? v : undef; return v > 4 ? v : undef;
} }
} },
};
$.fn[ pluginName ] = function (options) { //Enable the link on the second click.
return this.each(function () { doubleTapToGo: function(elem) {
if (!$.data(this, "plugin_" + pluginName)) { var $this = this.element;
$.data(this, "plugin_" + pluginName, new Plugin(this, options));
//if the class "doubleTapToGo" exists, remove it and return
if (elem.hasClass("doubleTapToGo")) {
elem.removeClass("doubleTapToGo");
return true;
} }
});
//does not exists, add a new class and return false
if (elem.parent().children("ul").length) {
//first remove all other class
$this.find(".doubleTapToGo").removeClass("doubleTapToGo");
//add the class on the current element
elem.addClass("doubleTapToGo");
return false;
}
},
remove: function() {
this.element.off("." + pluginName);
this.element.removeData(pluginName);
}
}; };
})(jQuery, window, document); $.fn[pluginName] = function(options) {
this.each(function () {
var el = $(this);
if (el.data(pluginName)) {
el.data(pluginName).remove();
}
el.data(pluginName, new Plugin(this, options));
});
return this;
};
})(jQuery, window, document);

View File

@@ -1,9 +1,9 @@
/* /*
* metismenu - v1.0.3 * metismenu - v1.1.3
* Easy menu jQuery plugin for Twitter Bootstrap 3 * Easy menu jQuery plugin for Twitter Bootstrap 3
* https://github.com/onokumus/metisMenu * https://github.com/onokumus/metisMenu
* *
* Made by Osman Nuri Okumuş * Made by Osman Nuri Okumus
* Under MIT License * Under MIT License
*/ */
!function(a,b,c){function d(b,c){this.element=b,this.settings=a.extend({},f,c),this._defaults=f,this._name=e,this.init()}var e="metisMenu",f={toggle:!0};d.prototype={init:function(){var b=a(this.element),c=this.settings.toggle;this.isIE()<=9?(b.find("li.active").has("ul").children("ul").collapse("show"),b.find("li").not(".active").has("ul").children("ul").collapse("hide")):(b.find("li.active").has("ul").children("ul").addClass("collapse in"),b.find("li").not(".active").has("ul").children("ul").addClass("collapse")),b.find("li").has("ul").children("a").on("click",function(b){b.preventDefault(),a(this).parent("li").toggleClass("active").children("ul").collapse("toggle"),c&&a(this).parent("li").siblings().removeClass("active").children("ul.in").collapse("hide")})},isIE:function(){for(var a,b=3,d=c.createElement("div"),e=d.getElementsByTagName("i");d.innerHTML="<!--[if gt IE "+ ++b+"]><i></i><![endif]-->",e[0];)return b>4?b:a}},a.fn[e]=function(b){return this.each(function(){a.data(this,"plugin_"+e)||a.data(this,"plugin_"+e,new d(this,b))})}}(jQuery,window,document); !function(a,b,c){function d(b,c){this.element=a(b),this.settings=a.extend({},f,c),this._defaults=f,this._name=e,this.init()}var e="metisMenu",f={toggle:!0,doubleTapToGo:!1};d.prototype={init:function(){var b=this.element,d=this.settings.toggle,f=this;this.isIE()<=9?(b.find("li.active").has("ul").children("ul").collapse("show"),b.find("li").not(".active").has("ul").children("ul").collapse("hide")):(b.find("li.active").has("ul").children("ul").addClass("collapse in"),b.find("li").not(".active").has("ul").children("ul").addClass("collapse")),f.settings.doubleTapToGo&&b.find("li.active").has("ul").children("a").addClass("doubleTapToGo"),b.find("li").has("ul").children("a").on("click."+e,function(b){return b.preventDefault(),f.settings.doubleTapToGo&&f.doubleTapToGo(a(this))&&"#"!==a(this).attr("href")&&""!==a(this).attr("href")?(b.stopPropagation(),void(c.location=a(this).attr("href"))):(a(this).parent("li").toggleClass("active").children("ul").collapse("toggle"),void(d&&a(this).parent("li").siblings().removeClass("active").children("ul.in").collapse("hide")))})},isIE:function(){for(var a,b=3,d=c.createElement("div"),e=d.getElementsByTagName("i");d.innerHTML="<!--[if gt IE "+ ++b+"]><i></i><![endif]-->",e[0];)return b>4?b:a},doubleTapToGo:function(a){var b=this.element;return a.hasClass("doubleTapToGo")?(a.removeClass("doubleTapToGo"),!0):a.parent().children("ul").length?(b.find(".doubleTapToGo").removeClass("doubleTapToGo"),a.addClass("doubleTapToGo"),!1):void 0},remove:function(){this.element.off("."+e),this.element.removeData(e)}},a.fn[e]=function(b){return this.each(function(){var c=a(this);c.data(e)&&c.data(e).remove(),c.data(e,new d(this,b))}),this}}(jQuery,window,document);

View File

@@ -25,4 +25,12 @@ $(function() {
$("#page-wrapper").css("min-height", (height) + "px"); $("#page-wrapper").css("min-height", (height) + "px");
} }
}); });
var url = window.location;
var element = $('ul.nav a').filter(function() {
return this.href == url;
}).addClass('active').parent().parent().addClass('in').parent();
if (element.is('li')) {
element.addClass('active');
}
}); });

View File

@@ -279,14 +279,14 @@
<li> <li>
<a href="index.html"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a> <a href="index.html"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
</li> </li>
<li class="active"> <li>
<a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> Charts<span class="fa arrow"></span></a> <a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> Charts<span class="fa arrow"></span></a>
<ul class="nav nav-second-level"> <ul class="nav nav-second-level">
<li> <li>
<a href="flot.html">Flot Charts</a> <a href="flot.html">Flot Charts</a>
</li> </li>
<li> <li>
<a class="active" href="morris.html">Morris.js Charts</a> <a href="morris.html">Morris.js Charts</a>
</li> </li>
</ul> </ul>
<!-- /.nav-second-level --> <!-- /.nav-second-level -->

View File

@@ -294,7 +294,7 @@
<li> <li>
<a href="forms.html"><i class="fa fa-edit fa-fw"></i> Forms</a> <a href="forms.html"><i class="fa fa-edit fa-fw"></i> Forms</a>
</li> </li>
<li class="active"> <li>
<a href="#"><i class="fa fa-wrench fa-fw"></i> UI Elements<span class="fa arrow"></span></a> <a href="#"><i class="fa fa-wrench fa-fw"></i> UI Elements<span class="fa arrow"></span></a>
<ul class="nav nav-second-level"> <ul class="nav nav-second-level">
<li> <li>
@@ -304,7 +304,7 @@
<a href="buttons.html">Buttons</a> <a href="buttons.html">Buttons</a>
</li> </li>
<li> <li>
<a class="active" href="notifications.html">Notifications</a> <a href="notifications.html">Notifications</a>
</li> </li>
<li> <li>
<a href="typography.html">Typography</a> <a href="typography.html">Typography</a>

View File

@@ -294,11 +294,11 @@
<li> <li>
<a href="forms.html"><i class="fa fa-edit fa-fw"></i> Forms</a> <a href="forms.html"><i class="fa fa-edit fa-fw"></i> Forms</a>
</li> </li>
<li class="active"> <li>
<a href="#"><i class="fa fa-wrench fa-fw"></i> UI Elements<span class="fa arrow"></span></a> <a href="#"><i class="fa fa-wrench fa-fw"></i> UI Elements<span class="fa arrow"></span></a>
<ul class="nav nav-second-level"> <ul class="nav nav-second-level">
<li> <li>
<a class="active" href="panels-wells.html">Panels and Wells</a> <a href="panels-wells.html">Panels and Wells</a>
</li> </li>
<li> <li>
<a href="buttons.html">Buttons</a> <a href="buttons.html">Buttons</a>

View File

@@ -292,7 +292,7 @@
<!-- /.nav-second-level --> <!-- /.nav-second-level -->
</li> </li>
<li> <li>
<a class="active" href="tables.html"><i class="fa fa-table fa-fw"></i> Tables</a> <a href="tables.html"><i class="fa fa-table fa-fw"></i> Tables</a>
</li> </li>
<li> <li>
<a href="forms.html"><i class="fa fa-edit fa-fw"></i> Forms</a> <a href="forms.html"><i class="fa fa-edit fa-fw"></i> Forms</a>

View File

@@ -294,7 +294,7 @@
<li> <li>
<a href="forms.html"><i class="fa fa-edit fa-fw"></i> Forms</a> <a href="forms.html"><i class="fa fa-edit fa-fw"></i> Forms</a>
</li> </li>
<li class="active"> <li>
<a href="#"><i class="fa fa-wrench fa-fw"></i> UI Elements<span class="fa arrow"></span></a> <a href="#"><i class="fa fa-wrench fa-fw"></i> UI Elements<span class="fa arrow"></span></a>
<ul class="nav nav-second-level"> <ul class="nav nav-second-level">
<li> <li>
@@ -307,7 +307,7 @@
<a href="notifications.html">Notifications</a> <a href="notifications.html">Notifications</a>
</li> </li>
<li> <li>
<a class="active" href="typography.html">Typography</a> <a href="typography.html">Typography</a>
</li> </li>
<li> <li>
<a href="icons.html"> Icons</a> <a href="icons.html"> Icons</a>