summaryrefslogtreecommitdiff
path: root/js/plugins/metisMenu
diff options
context:
space:
mode:
authorprashantsinalkar2019-04-22 12:35:05 +0530
committerprashantsinalkar2019-04-22 12:35:05 +0530
commit4ba4ccc3fddb242251d5442c78aba14f43835035 (patch)
tree143fb83eb49ec1001e5be0ca87302858f6bca6fe /js/plugins/metisMenu
parent4dc90c39ae1a07db5f6f567fae84513c69ca1ac1 (diff)
downloadosdag_workshop_2019-4ba4ccc3fddb242251d5442c78aba14f43835035.tar.gz
osdag_workshop_2019-4ba4ccc3fddb242251d5442c78aba14f43835035.tar.bz2
osdag_workshop_2019-4ba4ccc3fddb242251d5442c78aba14f43835035.zip
created index page
Diffstat (limited to 'js/plugins/metisMenu')
-rwxr-xr-xjs/plugins/metisMenu/metisMenu.js72
-rwxr-xr-xjs/plugins/metisMenu/metisMenu.min.js9
2 files changed, 81 insertions, 0 deletions
diff --git a/js/plugins/metisMenu/metisMenu.js b/js/plugins/metisMenu/metisMenu.js
new file mode 100755
index 0000000..9f8d627
--- /dev/null
+++ b/js/plugins/metisMenu/metisMenu.js
@@ -0,0 +1,72 @@
+/*
+ * metismenu - v1.0.3
+ * Easy menu jQuery plugin for Twitter Bootstrap 3
+ * https://github.com/onokumus/metisMenu
+ *
+ * Made by Osman Nuri Okumuş
+ * Under MIT License
+ */
+;(function ($, window, document, undefined) {
+
+ var pluginName = "metisMenu",
+ defaults = {
+ toggle: true
+ };
+
+ function Plugin(element, options) {
+ this.element = element;
+ this.settings = $.extend({}, defaults, options);
+ this._defaults = defaults;
+ this._name = pluginName;
+ this.init();
+ }
+
+ Plugin.prototype = {
+ init: function () {
+
+ var $this = $(this.element),
+ $toggle = this.settings.toggle;
+
+ if (this.isIE() <= 9) {
+ $this.find("li.active").has("ul").children("ul").collapse("show");
+ $this.find("li").not(".active").has("ul").children("ul").collapse("hide");
+ } else {
+ $this.find("li.active").has("ul").children("ul").addClass("collapse in");
+ $this.find("li").not(".active").has("ul").children("ul").addClass("collapse");
+ }
+
+ $this.find("li").has("ul").children("a").on("click", function (e) {
+ e.preventDefault();
+
+ $(this).parent("li").toggleClass("active").children("ul").collapse("toggle");
+
+ if ($toggle) {
+ $(this).parent("li").siblings().removeClass("active").children("ul.in").collapse("hide");
+ }
+ });
+ },
+
+ isIE: function() {//https://gist.github.com/padolsey/527683
+ var undef,
+ v = 3,
+ div = document.createElement("div"),
+ all = div.getElementsByTagName("i");
+
+ while (
+ div.innerHTML = "<!--[if gt IE " + (++v) + "]><i></i><![endif]-->",
+ all[0]
+ ) {
+ return v > 4 ? v : undef;
+ }
+ }
+ };
+
+ $.fn[ pluginName ] = function (options) {
+ return this.each(function () {
+ if (!$.data(this, "plugin_" + pluginName)) {
+ $.data(this, "plugin_" + pluginName, new Plugin(this, options));
+ }
+ });
+ };
+
+})(jQuery, window, document);
diff --git a/js/plugins/metisMenu/metisMenu.min.js b/js/plugins/metisMenu/metisMenu.min.js
new file mode 100755
index 0000000..03ac02b
--- /dev/null
+++ b/js/plugins/metisMenu/metisMenu.min.js
@@ -0,0 +1,9 @@
+/*
+ * metismenu - v1.0.3
+ * Easy menu jQuery plugin for Twitter Bootstrap 3
+ * https://github.com/onokumus/metisMenu
+ *
+ * Made by Osman Nuri Okumuş
+ * 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); \ No newline at end of file