mirror of
https://github.com/mcneel/opennurbs.git
synced 2026-03-30 23:57:58 +08:00
Publish!
Generated from v6.0.11315.11111-test14
This commit is contained in:
@@ -1,17 +1,18 @@
|
||||
/*!
|
||||
* SmartMenus jQuery Plugin Bootstrap Addon - v0.3.1 - November 1, 2016
|
||||
/*
|
||||
* SmartMenus jQuery Bootstrap Addon - v0.4.1
|
||||
* http://www.smartmenus.org/
|
||||
*
|
||||
* Copyright Vasil Dinkov, Vadikom Web Ltd.
|
||||
* http://vadikom.com
|
||||
* http://vadikom.com/
|
||||
*
|
||||
* Licensed MIT
|
||||
* Released under the MIT license:
|
||||
* http://www.opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
(function(factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD
|
||||
define(['jquery', 'jquery.smartmenus'], factory);
|
||||
define(['jquery', 'smartmenus'], factory);
|
||||
} else if (typeof module === 'object' && typeof module.exports === 'object') {
|
||||
// CommonJS
|
||||
module.exports = factory(require('jquery'));
|
||||
@@ -32,9 +33,7 @@
|
||||
// if this navbar is not initialized
|
||||
if (!obj) {
|
||||
$this.smartmenus({
|
||||
|
||||
// these are some good default options that should work for all
|
||||
// you can, of course, tweak these as you like
|
||||
subMenusSubOffsetX: 2,
|
||||
subMenusSubOffsetY: -6,
|
||||
subIndicators: false,
|
||||
@@ -43,7 +42,7 @@
|
||||
rightToLeftSubMenus: $this.hasClass('navbar-right'),
|
||||
bottomToTopSubMenus: $this.closest('.navbar').hasClass('navbar-fixed-bottom')
|
||||
})
|
||||
.bind({
|
||||
.on({
|
||||
// set/unset proper Bootstrap classes for some menu elements
|
||||
'show.smapi': function(e, menu) {
|
||||
var $menu = $(menu),
|
||||
@@ -93,7 +92,7 @@
|
||||
|
||||
// custom "isCollapsible" method for Bootstrap
|
||||
obj.isCollapsible = function() {
|
||||
return !/^(left|right)$/.test(this.$firstLink.parent().css('float'));
|
||||
return !/^(left|right)$/.test(this.$firstLink.parent().css('float')) && this.$root.css('display') == 'block';
|
||||
};
|
||||
|
||||
// custom "refresh" method for Bootstrap
|
||||
@@ -113,20 +112,7 @@
|
||||
// keep Bootstrap's default behavior for parent items when the "data-sm-skip-collapsible-behavior" attribute is set to the ul.navbar-nav
|
||||
// i.e. use the whole item area just as a sub menu toggle and don't customize the carets
|
||||
if ($this.is('[data-sm-skip-collapsible-behavior]')) {
|
||||
$this.bind({
|
||||
// click the parent item to toggle the sub menus (and reset deeper levels and other branches on click)
|
||||
'click.smapi': function(e, item) {
|
||||
if (obj.isCollapsible()) {
|
||||
var $item = $(item),
|
||||
$sub = $item.parent().dataSM('sub');
|
||||
if ($sub && $sub.dataSM('shown-before') && $sub.is(':visible')) {
|
||||
obj.itemActivate($item);
|
||||
obj.menuHide($sub);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
obj.opts.collapsibleBehavior = 'toggle';
|
||||
}
|
||||
|
||||
// onresize detect when the navbar becomes collapsible and add it the "sm-collapsible" class
|
||||
@@ -151,7 +137,7 @@
|
||||
}
|
||||
}
|
||||
detectCollapsible();
|
||||
$(window).bind('resize.smartmenus' + obj.rootId, detectCollapsible);
|
||||
$(window).on('resize.smartmenus' + obj.rootId, detectCollapsible);
|
||||
}
|
||||
});
|
||||
// keydown fix for Bootstrap 3.3.5+ conflict
|
||||
@@ -171,4 +157,4 @@
|
||||
$($.SmartMenus.Bootstrap.init);
|
||||
|
||||
return $;
|
||||
}));
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user