mirror of
https://github.com/jasny/bootstrap.git
synced 2026-04-24 03:00:49 -04:00
Compare commits
11 Commits
v3.1.0
...
dropdown-s
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
032a42cca8 | ||
|
|
ec797fb799 | ||
|
|
36613f1655 | ||
|
|
2ac056ab82 | ||
|
|
523965b3d5 | ||
|
|
59aef49163 | ||
|
|
ac9e37fc64 | ||
|
|
00a5a2d55b | ||
|
|
9b5357120e | ||
|
|
a43e720494 | ||
|
|
32a5370467 |
@@ -371,6 +371,9 @@ module.exports = function (grunt) {
|
||||
// Default task.
|
||||
grunt.registerTask('default', ['dist', 'build-customizer']);
|
||||
|
||||
// Documentation task.
|
||||
grunt.registerTask('docs', ['jekyll', 'dist-docs']);
|
||||
|
||||
// Version numbering task.
|
||||
// grunt change-version-number --oldver=A.B.C --newver=X.Y.Z
|
||||
// This can be overzealous, so its changes should always be manually reviewed!
|
||||
@@ -386,5 +389,5 @@ module.exports = function (grunt) {
|
||||
|
||||
// Task for updating the npm packages used by the Travis build.
|
||||
grunt.registerTask('update-shrinkwrap', ['exec:npmUpdate', 'exec:npmShrinkWrap', '_update-shrinkwrap']);
|
||||
grunt.registerTask('_update-shrinkwrap', function () { updateShrinkwrap.call(this, grunt); });
|
||||
grunt.registerTask('∆update-shrinkwrap', function () { updateShrinkwrap.call(this, grunt); });
|
||||
};
|
||||
|
||||
72
README.md
72
README.md
@@ -1,6 +1,6 @@
|
||||
# [Jasny Bootstrap](http://jasny.github.io/bootstrap/) [](http://travis-ci.org/jasny/bootstrap)[](https://david-dm.org/jasny/bootstrap#info=devDependencies)
|
||||
|
||||
Jasny Bootstrap is a fork of the famous [Twitter Bootstrap](http://getbootstrap.com/) with added components.
|
||||
Jasny Bootstrap is an extension of the famous [Twitter Bootstrap](http://getbootstrap.com/), adding the following components:
|
||||
|
||||
* [Button labels](http://jasny.github.io/bootstrap/css/#buttons-labels)
|
||||
* [Off canvas navmenu](http://jasny.github.io/bootstrap/components/#navmenu)
|
||||
@@ -16,9 +16,9 @@ To get started, check out <http://jasny.github.io/bootstrap>!
|
||||
|
||||
Three quick start options are available:
|
||||
|
||||
* [Download the latest release](https://github.com/jasny/bootstrap/releases/tag/v3.0.0-p7).
|
||||
* [Download the latest release](https://github.com/jasny/bootstrap/releases/download/v3.1.0/jasny-bootstrap-3.1.0-dist.zip).
|
||||
* Clone the repo: `git clone git://github.com/jasny/bootstrap.git`.
|
||||
* Install with [Bower](http://bower.io): `bower install bootstrap=jasny/bootstrap`. To install Jasny Bootstrap next to Twitter Bootstrap use `bower install jasny-bootstrap=jasny/bootstrap`.
|
||||
* Install with [Bower](http://bower.io): `bower install bootstrap=jasny-bootstrap`.
|
||||
|
||||
Read the [Getting Started page](http://jasny.github.io/bootstrap/getting-started/) for information on the framework contents, templates and examples, and more.
|
||||
|
||||
@@ -27,28 +27,7 @@ Read the [Getting Started page](http://jasny.github.io/bootstrap/getting-started
|
||||
Within the download you'll find the following directories and files, logically grouping common assets and providing both compiled and minified variations. You'll see something like this:
|
||||
|
||||
```
|
||||
bootstrap/
|
||||
├── css/
|
||||
│ ├── bootstrap.css
|
||||
│ ├── bootstrap.min.css
|
||||
│ ├── bootstrap-theme.css
|
||||
│ └── bootstrap-theme.min.css
|
||||
├── js/
|
||||
│ ├── bootstrap.js
|
||||
│ └── bootstrap.min.js
|
||||
└── fonts/
|
||||
├── glyphicons-halflings-regular.eot
|
||||
├── glyphicons-halflings-regular.svg
|
||||
├── glyphicons-halflings-regular.ttf
|
||||
└── glyphicons-halflings-regular.woff
|
||||
```
|
||||
|
||||
We provide compiled CSS and JS (`bootstrap.*`), as well as compiled and minified CSS and JS (`bootstrap.min.*`). Fonts from Glyphicons are included, as is the optional Bootstrap theme.
|
||||
|
||||
Alternatively you can extend Twitter Bootstrap by downloading <code>jasny-bootstrap.*</code> files from the extension package, in conjunction with the original Twitter Bootstrap files or a custom build of Bootstrap. The structure of (the compiled) Jasny Bootstrap extension package is:
|
||||
|
||||
```
|
||||
extend/
|
||||
jasny-bootstrap/
|
||||
├── css/
|
||||
│ ├── jasny-bootstrap.css
|
||||
│ ├── jasny-bootstrap.min.css
|
||||
@@ -57,6 +36,11 @@ extend/
|
||||
└── jasny-bootstrap.min.js
|
||||
```
|
||||
|
||||
We provide compiled CSS and JS (`jasny-bootstrap.*`), as well as compiled and minified CSS and JS (`jasny-bootstrap.min.*`).
|
||||
|
||||
Jasny Bootstrap should be loaded after Twitter Bootstrap.
|
||||
|
||||
|
||||
## Bugs and feature requests
|
||||
|
||||
Have a bug or a feature request? [Please open a new issue](https://github.com/jasny/bootstrap/issues). Before opening any issue, please search for existing issues and read the [Issue Guidelines](https://github.com/necolas/issue-guidelines), written by [Nicolas Gallagher](https://github.com/necolas/).
|
||||
@@ -67,7 +51,7 @@ You may use [this JS Bin](http://jsbin.com/iKumuWo/1/edit) as a template for you
|
||||
|
||||
## Documentation
|
||||
|
||||
Bootstrap's documentation, included in this repo in the root directory, is built with [Jekyll](http://jekyllrb.com) and publicly hosted on GitHub Pages at <http://jasny.github.io/bootstrap>. The docs may also be run locally.
|
||||
Jasny Bootstrap's documentation, included in this repo in the root directory, is built with [Jekyll](http://jekyllrb.com) and publicly hosted on GitHub Pages at <http://jasny.github.io/bootstrap>. The docs may also be run locally.
|
||||
|
||||
### Running documentation locally
|
||||
|
||||
@@ -80,7 +64,7 @@ Learn more about using Jekyll by reading its [documentation](http://jekyllrb.com
|
||||
|
||||
### Documentation for previous releases
|
||||
|
||||
Documentation for v2.3.2 has been made available for the time being at <http://jasny.github.io/bootstrap/2.3.2/> while folks transition to Bootstrap 3.
|
||||
Documentation for v2.3.1 has been made available for the time being at <http://jasny.github.io/bootstrap/2.3.1/> while folks transition to Bootstrap 3.
|
||||
|
||||
[Previous releases](https://github.com/jasny/bootstrap/releases) and their documentation are also available for download.
|
||||
|
||||
@@ -123,15 +107,12 @@ Should you encounter problems with installing dependencies or running Grunt comm
|
||||
|
||||
## Contributing
|
||||
|
||||
Please read through our [contributing guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md). Included are directions for opening issues, coding standards, and notes on development.
|
||||
Please read through our [contributing guidelines](https://github.com/jasny/bootstrap/blob/master/CONTRIBUTING.md). Included are directions for opening issues, coding standards, and notes on development.
|
||||
|
||||
More over, if your pull request contains JavaScript patches or features, you must include relevant unit tests. All HTML and CSS should conform to the [Code Guide](http://github.com/mdo/code-guide), maintained by [Mark Otto](http://github.com/mdo).
|
||||
|
||||
Editor preferences are available in the [editor config](.editorconfig) for easy use in common text editors. Read more and download plugins at <http://editorconfig.org>.
|
||||
|
||||
With v3.1, we're moving from the Apache 2 to the MIT license for the Bootstrap code (not the docs). Please see the [contributing guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md) for more information.
|
||||
|
||||
|
||||
## Community
|
||||
|
||||
Keep track of development and community news.
|
||||
@@ -141,28 +122,28 @@ Keep track of development and community news.
|
||||
|
||||
|
||||
|
||||
|
||||
## Versioning
|
||||
|
||||
Jasny Bootstrap follows the version of Twitter Bootstrap added with a custom patch number.
|
||||
For transparency into our release cycle and in striving to maintain backward compatibility, Jasny Bootstrap is maintained under the Semantic Versioning guidelines. Sometimes we screw up, but we'll adhere to these rules whenever possible.
|
||||
|
||||
`<major>.<minor>.<patch>-p<jasny patch>`
|
||||
Releases will be numbered with the following format:
|
||||
|
||||
`<major>.<minor>.<patch>`
|
||||
|
||||
And constructed with the following guidelines:
|
||||
|
||||
- Breaking backward compatibility **bumps the major** while resetting minor and patch
|
||||
- New additions without breaking backward compatibility **bumps the minor** while resetting the patch
|
||||
- Bug fixes and misc changes **bumps only the patch**
|
||||
|
||||
For more information on SemVer, please visit <http://semver.org/>.
|
||||
|
||||
__The major version will follow Twitter Bootstraps major version. This means backward compatibility will only be broken if Twitter Bootstrap does so.__
|
||||
|
||||
Backwards compatibility is only broken if Twitter Bootstrap also does so, in which case the major is incremented.
|
||||
|
||||
|
||||
## Authors
|
||||
|
||||
**Mark Otto**
|
||||
|
||||
+ <http://twitter.com/mdo>
|
||||
+ <http://github.com/mdo>
|
||||
|
||||
**Jacob Thornton**
|
||||
|
||||
+ <http://twitter.com/fat>
|
||||
+ <http://github.com/fat>
|
||||
|
||||
**Arnold Daniels**
|
||||
|
||||
+ [http://twitter.com/ArnoldDaniels](http://twitter.com/ArnoldDaniels)
|
||||
@@ -172,5 +153,4 @@ Backwards compatibility is only broken if Twitter Bootstrap also does so, in whi
|
||||
|
||||
## Copyright and license
|
||||
|
||||
Copyright 2013 Twitter, Inc under [the Apache 2.0 license](LICENSE).
|
||||
Copyright 2013 Jasny BV under [the Apache 2.0 license](LICENSE).
|
||||
|
||||
@@ -24,7 +24,7 @@ repo: https://github.com/jasny/bootstrap
|
||||
|
||||
download:
|
||||
source: https://github.com/jasny/bootstrap/archive/v3.1.0.zip
|
||||
dist: https://github.com/jasny/bootstrap/releases/download/v3.1.0/bootstrap-3.1.0-dist.zip
|
||||
dist: https://github.com/jasny/bootstrap/releases/download/v3.1.0/jasny-bootstrap-3.1.0-dist.zip
|
||||
|
||||
cdn:
|
||||
css: //cdnjs.cloudflare.com/ajax/libs/jasny-bootstrap/3.1.0/css/jasny-bootstrap.min.css
|
||||
|
||||
61
dist/css/jasny-bootstrap.css
vendored
61
dist/css/jasny-bootstrap.css
vendored
@@ -1,12 +1,15 @@
|
||||
/*!
|
||||
* Jasny Bootstrap v3.1.0 (http://jasny.github.io/bootstrap)
|
||||
* Jasny Bootstrap v3.1.1 (http://jasny.github.io/bootstrap)
|
||||
* Copyright 2012-2014 Arnold Daniels
|
||||
* Licensed under Apache-2.0 (https://github.com/jasny/bootstrap/blob/master/LICENSE)
|
||||
*/
|
||||
|
||||
.container-smooth {
|
||||
max-width: 1170px;
|
||||
}
|
||||
@media (min-width: 1px) {
|
||||
.container-smooth {
|
||||
max-width: 1170px;
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
.btn-labeled {
|
||||
@@ -57,6 +60,43 @@
|
||||
left: auto;
|
||||
border-radius: 0 2px 2px 0;
|
||||
}
|
||||
.dropdown-menu .dropdown {
|
||||
position: relative;
|
||||
}
|
||||
.dropdown-menu .dropdown > .dropdown-menu {
|
||||
top: 0;
|
||||
left: 100%;
|
||||
margin-top: -6px;
|
||||
margin-left: -1px;
|
||||
border-radius: 0 6px 6px 6px;
|
||||
|
||||
-webkit-border-radius: 0 6px 6px 6px;
|
||||
-moz-border-radius: 0 6px 6px;
|
||||
}
|
||||
.dropdown-menu .dropdown > a:after {
|
||||
display: block;
|
||||
float: right;
|
||||
width: 0;
|
||||
height: 0;
|
||||
margin-top: 5px;
|
||||
margin-right: -10px;
|
||||
content: " ";
|
||||
border-color: transparent;
|
||||
border-style: solid;
|
||||
border-width: 5px 0 5px 5px;
|
||||
border-left-color: #ccc;
|
||||
}
|
||||
.dropdown-menu .dropdown.pull-left {
|
||||
float: none;
|
||||
}
|
||||
.dropdown-menu .dropdown.pull-left > .dropdown-menu {
|
||||
left: -100%;
|
||||
margin-left: 10px;
|
||||
border-radius: 6px 0 6px 6px;
|
||||
|
||||
-webkit-border-radius: 6px 0 6px 6px;
|
||||
-moz-border-radius: 6px 0 6px 6px;
|
||||
}
|
||||
.nav-tabs-bottom {
|
||||
border-top: 1px solid #ddd;
|
||||
border-bottom: 0;
|
||||
@@ -151,12 +191,15 @@
|
||||
border-radius: 0;
|
||||
}
|
||||
.navmenu-fixed-left,
|
||||
.navbar-offcanvas {
|
||||
.navbar-offcanvas.navmenu-fixed-left {
|
||||
right: auto;
|
||||
left: 0;
|
||||
border-width: 0 1px 0 0;
|
||||
}
|
||||
.navmenu-fixed-right {
|
||||
.navmenu-fixed-right,
|
||||
.navbar-offcanvas {
|
||||
right: 0;
|
||||
left: auto;
|
||||
border-width: 0 0 0 1px;
|
||||
}
|
||||
.navmenu-nav {
|
||||
@@ -521,7 +564,8 @@
|
||||
cursor: pointer;
|
||||
filter: alpha(opacity=0);
|
||||
opacity: 0;
|
||||
transform: translate(-300px, 0) scale(4);
|
||||
-webkit-transform: translate(-300px, 0) scale(4);
|
||||
transform: translate(-300px, 0) scale(4);
|
||||
|
||||
direction: ltr;
|
||||
}
|
||||
@@ -565,13 +609,20 @@
|
||||
.form-control .fileinput-filename {
|
||||
vertical-align: bottom;
|
||||
}
|
||||
.fileinput.input-group {
|
||||
display: table;
|
||||
}
|
||||
.fileinput-new.input-group .btn-file,
|
||||
.fileinput-new .input-group .btn-file {
|
||||
border-radius: 0 4px 4px 0;
|
||||
}
|
||||
.fileinput-new.input-group .btn-file.btn-xs,
|
||||
.fileinput-new .input-group .btn-file.btn-xs,
|
||||
.fileinput-new.input-group .btn-file.btn-sm,
|
||||
.fileinput-new .input-group .btn-file.btn-sm {
|
||||
border-radius: 0 3px 3px 0;
|
||||
}
|
||||
.fileinput-new.input-group .btn-file.btn-lg,
|
||||
.fileinput-new .input-group .btn-file.btn-lg {
|
||||
border-radius: 0 6px 6px 0;
|
||||
}
|
||||
|
||||
2
dist/css/jasny-bootstrap.css.map
vendored
2
dist/css/jasny-bootstrap.css.map
vendored
File diff suppressed because one or more lines are too long
4
dist/css/jasny-bootstrap.min.css
vendored
4
dist/css/jasny-bootstrap.min.css
vendored
File diff suppressed because one or more lines are too long
128
dist/js/jasny-bootstrap.js
vendored
128
dist/js/jasny-bootstrap.js
vendored
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Jasny Bootstrap v3.1.0 (http://jasny.github.io/bootstrap)
|
||||
* Jasny Bootstrap v3.1.1 (http://jasny.github.io/bootstrap)
|
||||
* Copyright 2012-2014 Arnold Daniels
|
||||
* Licensed under Apache-2.0 (https://github.com/jasny/bootstrap/blob/master/LICENSE)
|
||||
*/
|
||||
@@ -7,12 +7,10 @@
|
||||
if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScript requires jQuery') }
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: offcanvas.js v3.0.3-p7
|
||||
* http://jasny.github.io/bootstrap/javascript.html#offcanvas
|
||||
*
|
||||
* Based on Boostrap collapse.js by Twitter, Inc.
|
||||
* Bootstrap: offcanvas.js v3.1.1
|
||||
* http://jasny.github.io/bootstrap/javascript/#offcanvas
|
||||
* ========================================================================
|
||||
* Copyright 2013 Jasny, BV.
|
||||
* Copyright 2013-2014 Arnold Daniels
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License")
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -36,6 +34,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
|
||||
this.$element = $(element)
|
||||
this.options = $.extend({}, OffCanvas.DEFAULTS, options)
|
||||
this.state = null
|
||||
this.placement = null
|
||||
|
||||
if (this.options.recalc) {
|
||||
this.calcClone()
|
||||
@@ -50,13 +49,14 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
|
||||
|
||||
OffCanvas.DEFAULTS = {
|
||||
toggle: true,
|
||||
placement: 'left',
|
||||
placement: 'auto',
|
||||
autohide: true,
|
||||
recalc: true
|
||||
recalc: true,
|
||||
disableScrolling: true
|
||||
}
|
||||
|
||||
OffCanvas.prototype.offset = function () {
|
||||
switch (this.options.placement) {
|
||||
switch (this.placement) {
|
||||
case 'left':
|
||||
case 'right': return this.$element.outerWidth()
|
||||
case 'top':
|
||||
@@ -65,26 +65,31 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
|
||||
}
|
||||
|
||||
OffCanvas.prototype.calcPlacement = function () {
|
||||
var horizontal = $(window).width() / this.$element.width(),
|
||||
vertical = $(window).height() / this.$element.height()
|
||||
|
||||
if (this.options.placement !== 'auto') {
|
||||
this.placement = this.options.placement
|
||||
return
|
||||
}
|
||||
|
||||
if (!this.$element.hasClass('in')) {
|
||||
this.$element.css('visiblity', 'hidden !important').addClass('in')
|
||||
}
|
||||
|
||||
var horizontal = $(window).width() / this.$element.width()
|
||||
var vertical = $(window).height() / this.$element.height()
|
||||
|
||||
var element = this.$element
|
||||
function ab(a, b) {
|
||||
if (element.css(b) === 'auto') return a
|
||||
if (element.css(a) === 'auto') return b
|
||||
|
||||
var size_a = parseInt(element.css(a), 10),
|
||||
size_b = parseInt(element.css(b), 10)
|
||||
var size_a = parseInt(element.css(a), 10)
|
||||
var size_b = parseInt(element.css(b), 10)
|
||||
|
||||
return size_a > size_b ? b : a
|
||||
}
|
||||
|
||||
this.options.placement = horizontal > vertical ? ab('left', 'right') : ab('top', 'bottom')
|
||||
|
||||
this.placement = horizontal >= vertical ? ab('left', 'right') : ab('top', 'bottom')
|
||||
|
||||
if (this.$element.css('visibility') === 'hidden !important') {
|
||||
this.$element.removeClass('in').css('visiblity', '')
|
||||
}
|
||||
@@ -114,12 +119,12 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
|
||||
// Use jQuery animation if CSS transitions aren't supported
|
||||
if (!$.support.transition) {
|
||||
var anim = {}
|
||||
anim[this.options.placement] = "+=" + offset
|
||||
anim[this.placement] = "+=" + offset
|
||||
return elements.animate(anim, 350, callback)
|
||||
}
|
||||
|
||||
var placement = this.options.placement,
|
||||
opposite = this.opposite(placement)
|
||||
var placement = this.placement
|
||||
var opposite = this.opposite(placement)
|
||||
|
||||
elements.each(function() {
|
||||
if ($(this).css(placement) !== 'auto')
|
||||
@@ -136,7 +141,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
|
||||
|
||||
OffCanvas.prototype.disableScrolling = function() {
|
||||
var bodyWidth = $('body').width()
|
||||
var prop = 'padding-' + this.opposite(this.options.placement)
|
||||
var prop = 'padding-' + this.opposite(this.placement)
|
||||
|
||||
if ($('body').data('offcanvas-style') === undefined) $('body').data('offcanvas-style', $('body').attr('style'))
|
||||
|
||||
@@ -158,17 +163,22 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
|
||||
this.$element.trigger(startEvent)
|
||||
if (startEvent.isDefaultPrevented()) return
|
||||
|
||||
if (this.options.placement === 'auto') this.calcPlacement()
|
||||
|
||||
this.state = 'sliding'
|
||||
|
||||
this.state = 'slide-in'
|
||||
this.calcPlacement();
|
||||
|
||||
var elements = this.getCanvasElements()
|
||||
var offset = this.offset(),
|
||||
placement = this.options.placement,
|
||||
opposite = this.opposite(placement)
|
||||
var placement = this.placement
|
||||
var opposite = this.opposite(placement)
|
||||
var offset = this.offset()
|
||||
|
||||
if (elements.index(this.$element) !== -1) {
|
||||
$(this.$element).data('offcanvas-style', $(this.$element).attr('style') || '')
|
||||
this.$element.css(placement, -1 * offset)
|
||||
this.$element.css(placement); // Workaround: Need to get the CSS property for it to be applied before the next line of code
|
||||
}
|
||||
|
||||
elements.addClass('canvas-sliding').each(function() {
|
||||
$(this).data('offcanvas-style', $(this).attr('style') || '')
|
||||
if ($(this).data('offcanvas-style') === undefined) $(this).data('offcanvas-style', $(this).attr('style') || '')
|
||||
if ($(this).css('position') === 'static') $(this).css('position', 'relative')
|
||||
if (($(this).css(placement) === 'auto' || $(this).css(placement) === '0px') &&
|
||||
($(this).css(opposite) === 'auto' || $(this).css(opposite) === '0px')) {
|
||||
@@ -176,11 +186,11 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
|
||||
}
|
||||
})
|
||||
|
||||
if (elements.index(this.$element) !== -1) this.$element.css(placement, -1 * offset)
|
||||
|
||||
this.disableScrolling()
|
||||
if (this.options.disableScrolling) this.disableScrolling()
|
||||
|
||||
var complete = function () {
|
||||
if (this.state != 'slide-in') return
|
||||
|
||||
this.state = 'slid'
|
||||
|
||||
elements.removeClass('canvas-sliding').addClass('canvas-slid')
|
||||
@@ -200,18 +210,22 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
|
||||
this.$element.trigger(startEvent)
|
||||
if (startEvent.isDefaultPrevented()) return
|
||||
|
||||
this.state = 'sliding'
|
||||
this.state = 'slide-out'
|
||||
|
||||
var elements = $('.canvas-slid')
|
||||
var placement = this.placement
|
||||
var offset = -1 * this.offset()
|
||||
|
||||
var complete = function () {
|
||||
if (this.state != 'slide-out') return
|
||||
|
||||
this.state = null
|
||||
|
||||
this.placement = null
|
||||
|
||||
this.$element.removeClass('in')
|
||||
|
||||
elements.removeClass('canvas-sliding')
|
||||
elements.add('body').each(function() {
|
||||
elements.add(this.$element).add('body').each(function() {
|
||||
$(this).attr('style', $(this).data('offcanvas-style')).removeData('offcanvas-style')
|
||||
})
|
||||
|
||||
@@ -226,7 +240,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
|
||||
}
|
||||
|
||||
OffCanvas.prototype.toggle = function () {
|
||||
if (this.state === 'sliding') return
|
||||
if (this.state === 'slide-in' || this.state === 'slide-out') return
|
||||
this[this.state === 'slid' ? 'hide' : 'show']()
|
||||
}
|
||||
|
||||
@@ -238,17 +252,18 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
|
||||
}
|
||||
|
||||
OffCanvas.prototype.recalc = function () {
|
||||
if (this.state() !== 'slid' || this.$calcClone.css('display') === 'none') return
|
||||
if (this.$calcClone.css('display') === 'none' || (this.state !== 'slid' && this.state !== 'slide-in')) return
|
||||
|
||||
var offset = -1 * this.offset()
|
||||
this.state = null
|
||||
this.placement = null
|
||||
var elements = this.getCanvasElements()
|
||||
|
||||
var placement = this.options.placement
|
||||
this.getCanvasElements().each(function() {
|
||||
$(this).css(placement, (parseInt($(this).css(placement), 10) || 0) + offset)
|
||||
}).removeClass('canvas-slid')
|
||||
this.$element.removeClass('in')
|
||||
|
||||
$('body').css('overflow', '')
|
||||
this.$element.css(placement, '').removeClass('in canvas-slid')
|
||||
elements.removeClass('canvas-slid')
|
||||
elements.add(this.$element).add('body').each(function() {
|
||||
$(this).attr('style', $(this).data('offcanvas-style')).removeData('offcanvas-style')
|
||||
})
|
||||
}
|
||||
|
||||
OffCanvas.prototype.autohide = function (e) {
|
||||
@@ -264,10 +279,10 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
var data = $this.data('bs.offcanvas')
|
||||
var options = $.extend({}, OffCanvas.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
||||
var options = $.extend({}, OffCanvas.DEFAULTS, $this.data(), typeof option === 'object' && option)
|
||||
|
||||
if (!data) $this.data('bs.offcanvas', (data = new OffCanvas(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
if (typeof option === 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -304,10 +319,10 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
|
||||
}(window.jQuery);
|
||||
|
||||
/* ============================================================
|
||||
* Bootstrap: rowlink.js v3.0.0-p7
|
||||
* http://jasny.github.io/bootstrap/javascript.html#rowlink
|
||||
* Bootstrap: rowlink.js v3.1.0
|
||||
* http://jasny.github.io/bootstrap/javascript/#rowlink
|
||||
* ============================================================
|
||||
* Copyright 2012 Jasny BV, Netherlands.
|
||||
* Copyright 2012-2014 Arnold Daniels
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -389,11 +404,12 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
|
||||
}(window.jQuery);
|
||||
|
||||
/* ===========================================================
|
||||
* Bootstrap: inputmask.js v3.0.0-p7
|
||||
* http://jasny.github.io/bootstrap/javascript.html#inputmask
|
||||
* Bootstrap: inputmask.js v3.1.0
|
||||
* http://jasny.github.io/bootstrap/javascript/#inputmask
|
||||
*
|
||||
* Based on Masked Input plugin by Josh Bush (digitalbush.com)
|
||||
* ===========================================================
|
||||
* Copyright 2012 Jasny BV, Netherlands.
|
||||
* Copyright 2012-2014 Arnold Daniels
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License")
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -749,10 +765,10 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
|
||||
}(window.jQuery);
|
||||
|
||||
/* ===========================================================
|
||||
* Bootstrap: fileinput.js v3.1.0
|
||||
* Bootstrap: fileinput.js v3.1.1
|
||||
* http://jasny.github.com/bootstrap/javascript/#fileinput
|
||||
* ===========================================================
|
||||
* Copyright 2012-2014 Jasny BV, Netherlands.
|
||||
* Copyright 2012-2014 Arnold Daniels
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License")
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -811,7 +827,11 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
|
||||
|
||||
Fileinput.prototype.change = function(e) {
|
||||
if (e.target.files === undefined) e.target.files = e.target && e.target.value ? [ {name: e.target.value.replace(/^.+\\/, '')} ] : []
|
||||
if (e.target.files.length === 0) return
|
||||
|
||||
if (e.target.files.length === 0) {
|
||||
this.clear()
|
||||
return
|
||||
}
|
||||
|
||||
this.$hidden.val('')
|
||||
this.$hidden.attr('name', '')
|
||||
|
||||
4
dist/js/jasny-bootstrap.min.js
vendored
4
dist/js/jasny-bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
6
docs/assets/js/customize.min.js
vendored
6
docs/assets/js/customize.min.js
vendored
File diff suppressed because one or more lines are too long
6
docs/assets/js/raw-files.min.js
vendored
6
docs/assets/js/raw-files.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -7,6 +7,68 @@ base_url: "../"
|
||||
---
|
||||
|
||||
|
||||
<!-- Multi level dropdowns
|
||||
================================================== -->
|
||||
<div class="bs-docs-section">
|
||||
<div class="page-header">
|
||||
<h1 id="navmenu">Multi level dropdowns</h1>
|
||||
</div>
|
||||
<p>Use multiple levels with <a href="http://getbootstrap.com/components/#dropdowns" target="_blank">Bootstrap's dropdown component</a> by adding a <code>.dropdown</code> a <code>.dropdown-menu</code>.</p>
|
||||
|
||||
<div class="bs-example">
|
||||
<div class="dropdown clearfix">
|
||||
<button class="btn dropdown-toggle sr-only" type="button" id="dropdownMenu1" data-toggle="dropdown">
|
||||
Dropdown
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu">
|
||||
<li><a href="#">Some action</a></li>
|
||||
<li><a href="#">Some other action</a></li>
|
||||
<li class="divider"></li>
|
||||
<li class="dropdown" data-toggle="dropdown">
|
||||
<a tabindex="-1" href="#">More options</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a tabindex="-1" href="#">Second level</a></li>
|
||||
<li class="dropdown" data-toggle="dropdown">
|
||||
<a href="#">Even more options</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#">3rd level</a></li>
|
||||
<li><a href="#">Yet another action</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{% highlight html %}
|
||||
<div class="dropdown">
|
||||
<button class="btn dropdown-toggle sr-only" type="button" id="dropdownMenu1" data-toggle="dropdown">
|
||||
Dropdown
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu">
|
||||
<li><a href="#">Some action</a></li>
|
||||
<li><a href="#">Some other action</a></li>
|
||||
<li class="divider"></li>
|
||||
<li class="dropdown" data-toggle="dropdown">
|
||||
<a tabindex="-1" href="#">More options</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a tabindex="-1" href="#">Second level</a></li>
|
||||
<li class="dropdown" data-toggle="dropdown">
|
||||
<a href="#">Even more options</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#">3rd level</a></li>
|
||||
<li><a href="#">Yet another action</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<!-- Navmenu
|
||||
================================================== -->
|
||||
<div class="bs-docs-section">
|
||||
|
||||
2
docs/dist/css/jasny-bootstrap.css.map
vendored
2
docs/dist/css/jasny-bootstrap.css.map
vendored
File diff suppressed because one or more lines are too long
4
docs/dist/css/jasny-bootstrap.min.css
vendored
4
docs/dist/css/jasny-bootstrap.min.css
vendored
File diff suppressed because one or more lines are too long
4
docs/dist/js/jasny-bootstrap.min.js
vendored
4
docs/dist/js/jasny-bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
95
docs/examples/dropdown/index.html
Normal file
95
docs/examples/dropdown/index.html
Normal file
@@ -0,0 +1,95 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
<link rel="shortcut icon" href="../../assets/ico/favicon.png">
|
||||
|
||||
<title>Navmenu Template for Bootstrap</title>
|
||||
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="../../dist/css/jasny-bootstrap.min.css" rel="stylesheet">
|
||||
|
||||
<!-- Custom styles for this template -->
|
||||
|
||||
<!-- Just for debugging purposes. Don't actually copy this line! -->
|
||||
<!--[if lt IE 9]><script src="../../docs-assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
|
||||
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!--[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 class="container">
|
||||
<div class="dropdown clearfix">
|
||||
<button class="btn dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown">
|
||||
Dropdown
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu">
|
||||
<li><a href="#">Some action</a></li>
|
||||
<li><a href="#">Some other action</a></li>
|
||||
<li class="divider"></li>
|
||||
<li class="dropdown">
|
||||
<a href="#" data-toggle="dropdown">More options</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#">Second level</a></li>
|
||||
<li class="dropdown">
|
||||
<a href="#" data-toggle="dropdown">Even more options</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#">3rd level</a></li>
|
||||
<li><a href="#">Yet another action</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="dropdown clearfix">
|
||||
<button class="btn dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown">
|
||||
Dropdown 2
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu">
|
||||
<li><a href="#">Some action</a></li>
|
||||
<li><a href="#">Some other action</a></li>
|
||||
<li class="divider"></li>
|
||||
<li class="dropdown">
|
||||
<a href="#" data-toggle="dropdown">More options</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#">Second level</a></li>
|
||||
<li class="dropdown">
|
||||
<a href="#" data-toggle="dropdown">Even more options</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#">3rd level</a></li>
|
||||
<li><a href="#">Yet another action</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Bootstrap core JavaScript
|
||||
================================================== -->
|
||||
<!-- Placed at the end of the document so the pages load faster -->
|
||||
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
|
||||
<!--script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script-->
|
||||
<script src="../../../js/dropdown.js"></script>
|
||||
<script src="../../dist/js/jasny-bootstrap.min.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).on('hidden.bs.dropdown', '.dropdown', function(e) {
|
||||
$(this).parents('[toggle=dropdown]').addClass('open')
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -44,9 +44,10 @@
|
||||
<div class="navbar-offcanvas offcanvas">
|
||||
<a class="navmenu-brand" href="#">Project name</a>
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="active"><a href="#">Link</a></li>
|
||||
<li><a href="#">Link</a></li>
|
||||
<li><a href="#">Link</a></li>
|
||||
<li><a href="../navmenu/">Slide in</a></li>
|
||||
<li><a href="../navmenu-push/">Push</a></li>
|
||||
<li><a href="../navmenu-reveal">Reveal</a></li>
|
||||
<li class="active"><a href="./">Off canvas navbar</a></li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
@@ -68,6 +69,11 @@
|
||||
<h1>Offcanvas Navbar example</h1>
|
||||
<p>This example demonstrates using the offcanvas plugin with the navbar.</p>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
By default the navbar is show on the right side of the screen. You can show it on the left side instead by
|
||||
adding <code>.navmenu-fixed-left</code> to the <code>.navbar-offcanvas</code>.
|
||||
</p>
|
||||
</div> <!-- /container -->
|
||||
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
<li><a href="../navmenu/">Slide in</a></li>
|
||||
<li class="active"><a href="./">Push</a></li>
|
||||
<li><a href="../navmenu-reveal/">Reveal</a></li>
|
||||
<li><a href="../navbar-offcanvas/">Off canvas navbar</a></li>
|
||||
</ul>
|
||||
<ul class="nav navmenu-nav">
|
||||
<li><a href="#">Link</a></li>
|
||||
@@ -76,5 +77,6 @@
|
||||
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
|
||||
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
|
||||
<script src="../../dist/js/jasny-bootstrap.min.js"></script>
|
||||
<script src="../../../js/offcanvas.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
<li><a href="../navmenu/">Slide in</a></li>
|
||||
<li><a href="../navmenu-push/">Push</a></li>
|
||||
<li class="active"><a href="./">Reveal</a></li>
|
||||
<li><a href="../navbar-offcanvas/">Off canvas navbar</a></li>
|
||||
</ul>
|
||||
<ul class="nav navmenu-nav">
|
||||
<li><a href="#">Link</a></li>
|
||||
@@ -69,7 +70,7 @@
|
||||
<p class="lead">This example demonstrates the use of the offcanvas plugin with a reveal effect.</p>
|
||||
<p>On the contrary of the push effect, the menu doesn't move with the canvas.</p>
|
||||
<p>You get the reveal effect by wrapping the content in a div and setting the <code>canvas</code> option to target that div.</p>
|
||||
<p>Note that in this example, the navmenu doesn't have the <code>.offcanvas</code> class, but is placed under the canvas by setting the <code>z-index</code>.</p>
|
||||
<p>Note that in this example, the navmenu doesn't have the <code>offcanvas</code> class, but is placed under the canvas by setting the <code>z-index</code>.</p>
|
||||
<p>Also take a look at the examples for a navmenu with <a href="../navmenu">slide in effect</a> and <a href="../navmenu-push">push effect</a>.</p>
|
||||
</div><!-- /.container -->
|
||||
</div>
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
<li class="active"><a href="./">Slide in</a></li>
|
||||
<li><a href="../navmenu-push/">Push</a></li>
|
||||
<li><a href="../navmenu-reveal/">Reveal</a></li>
|
||||
<li><a href="../navbar-offcanvas/">Off canvas navbar</a></li>
|
||||
</ul>
|
||||
<ul class="nav navmenu-nav">
|
||||
<li><a href="#">Link</a></li>
|
||||
@@ -40,7 +41,7 @@
|
||||
<li><a href="#">Link</a></li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu navmenu-nav">
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#">Action</a></li>
|
||||
<li><a href="#">Another action</a></li>
|
||||
<li><a href="#">Something else here</a></li>
|
||||
@@ -48,6 +49,13 @@
|
||||
<li class="dropdown-header">Nav header</li>
|
||||
<li><a href="#">Separated link</a></li>
|
||||
<li><a href="#">One more separated link</a></li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">2nd level dropdown <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#">Subaction</a></li>
|
||||
<li><a href="#">Another subaction</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -77,5 +85,11 @@
|
||||
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
|
||||
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
|
||||
<script src="../../dist/js/jasny-bootstrap.min.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('.dropdown').on('hidden', function(e) {
|
||||
alert(1);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -180,6 +180,12 @@ $('.navmenu').offcanvas()
|
||||
<td>true</td>
|
||||
<td>Calculate if off canvas should be disabled for this viewport width on window resize. If your elements always gets hidden on window resize, try setting this to false.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>disableScrolling</td>
|
||||
<td>boolean</td>
|
||||
<td>true</td>
|
||||
<td>Disable scrolling when the off canvas element is shown, by setting overflow to hidden for the body.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -416,21 +422,17 @@ $('.inputmask').inputmask({
|
||||
|
||||
<h3>File input widgets</h3>
|
||||
<div class="bs-example">
|
||||
<div class="fileinput fileinput-new" data-provides="fileinput">
|
||||
<div class="input-group">
|
||||
<div class="form-control" data-trigger="fileinput"><i class="glyphicon glyphicon-file fileinput-exists"></i> <span class="fileinput-filename"></span></div>
|
||||
<span class="input-group-addon btn btn-default btn-file"><span class="fileinput-new">Select file</span><span class="fileinput-exists">Change</span><input type="file"></span>
|
||||
<a href="#" class="input-group-addon btn btn-default fileinput-exists" data-dismiss="fileinput">Remove</a>
|
||||
</div>
|
||||
<div class="fileinput fileinput-new input-group" data-provides="fileinput">
|
||||
<div class="form-control" data-trigger="fileinput"><i class="glyphicon glyphicon-file fileinput-exists"></i> <span class="fileinput-filename"></span></div>
|
||||
<span class="input-group-addon btn btn-default btn-file"><span class="fileinput-new">Select file</span><span class="fileinput-exists">Change</span><input type="file"></span>
|
||||
<a href="#" class="input-group-addon btn btn-default fileinput-exists" data-dismiss="fileinput">Remove</a>
|
||||
</div>
|
||||
</div>
|
||||
{% highlight html %}
|
||||
<div class="fileinput fileinput-new" data-provides="fileinput">
|
||||
<div class="input-group">
|
||||
<div class="form-control" data-trigger="fileinput"><i class="glyphicon glyphicon-file fileinput-exists"></i> <span class="fileinput-filename"></span></div>
|
||||
<span class="input-group-addon btn btn-default btn-file"><span class="fileinput-new">Select file</span><span class="fileinput-exists">Change</span><input type="file" name="..."></span>
|
||||
<a href="#" class="input-group-addon btn btn-default fileinput-exists" data-dismiss="fileinput">Remove</a>
|
||||
</div>
|
||||
<div class="fileinput fileinput-new input-group" data-provides="fileinput">
|
||||
<div class="form-control" data-trigger="fileinput"><i class="glyphicon glyphicon-file fileinput-exists"></i> <span class="fileinput-filename"></span></div>
|
||||
<span class="input-group-addon btn btn-default btn-file"><span class="fileinput-new">Select file</span><span class="fileinput-exists">Change</span><input type="file" name="..."></span>
|
||||
<a href="#" class="input-group-addon btn btn-default fileinput-exists" data-dismiss="fileinput">Remove</a>
|
||||
</div>
|
||||
{% endhighlight %}
|
||||
|
||||
|
||||
147
js/dropdown.js
Normal file
147
js/dropdown.js
Normal file
@@ -0,0 +1,147 @@
|
||||
/* ========================================================================
|
||||
* Bootstrap: dropdown.js v3.1.1
|
||||
* http://getbootstrap.com/javascript/#dropdowns
|
||||
* ========================================================================
|
||||
* Copyright 2011-2014 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
|
||||
+function ($) {
|
||||
'use strict';
|
||||
|
||||
// DROPDOWN CLASS DEFINITION
|
||||
// =========================
|
||||
|
||||
var backdrop = '.dropdown-backdrop'
|
||||
var toggle = '[data-toggle="dropdown"]'
|
||||
var Dropdown = function (element) {
|
||||
$(element).on('click.bs.dropdown', this.toggle)
|
||||
}
|
||||
|
||||
Dropdown.prototype.toggle = function (e) {
|
||||
var $this = $(this)
|
||||
|
||||
if ($this.is('.disabled, :disabled')) return
|
||||
|
||||
var $parent = getParent($this)
|
||||
var isActive = $parent.hasClass('open')
|
||||
|
||||
clearMenus()
|
||||
|
||||
if (!isActive) {
|
||||
if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
|
||||
// if mobile we use a backdrop because click events don't delegate
|
||||
$('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
|
||||
}
|
||||
|
||||
var relatedTarget = { relatedTarget: this }
|
||||
$parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
|
||||
|
||||
if (e.isDefaultPrevented()) return
|
||||
|
||||
$parent
|
||||
.toggleClass('open')
|
||||
.trigger('shown.bs.dropdown', relatedTarget)
|
||||
|
||||
$this.trigger('focus')
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
Dropdown.prototype.keydown = function (e) {
|
||||
if (!/(38|40|27)/.test(e.keyCode)) return
|
||||
|
||||
var $this = $(this)
|
||||
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
|
||||
if ($this.is('.disabled, :disabled')) return
|
||||
|
||||
var $parent = getParent($this)
|
||||
var isActive = $parent.hasClass('open')
|
||||
|
||||
if (!isActive || (isActive && e.keyCode == 27)) {
|
||||
if (e.which == 27) $parent.find(toggle).trigger('focus')
|
||||
return $this.trigger('click')
|
||||
}
|
||||
|
||||
var desc = ' li:not(.divider):visible a'
|
||||
var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc)
|
||||
|
||||
if (!$items.length) return
|
||||
|
||||
var index = $items.index($items.filter(':focus'))
|
||||
|
||||
if (e.keyCode == 38 && index > 0) index-- // up
|
||||
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
|
||||
if (!~index) index = 0
|
||||
|
||||
$items.eq(index).trigger('focus')
|
||||
}
|
||||
|
||||
function clearMenus(e) {
|
||||
$(backdrop).remove()
|
||||
$(toggle).each(function () {
|
||||
var $parent = getParent($(this))
|
||||
var relatedTarget = { relatedTarget: this }
|
||||
if (!$parent.hasClass('open')) return
|
||||
$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
|
||||
if (e.isDefaultPrevented()) return
|
||||
$parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
|
||||
})
|
||||
}
|
||||
|
||||
function getParent($this) {
|
||||
var selector = $this.attr('data-target')
|
||||
|
||||
if (!selector) {
|
||||
selector = $this.attr('href')
|
||||
selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
||||
}
|
||||
|
||||
var $parent = selector && $(selector)
|
||||
|
||||
return $parent && $parent.length ? $parent : $this.parent()
|
||||
}
|
||||
|
||||
|
||||
// DROPDOWN PLUGIN DEFINITION
|
||||
// ==========================
|
||||
|
||||
var old = $.fn.dropdown
|
||||
|
||||
$.fn.dropdown = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
var data = $this.data('bs.dropdown')
|
||||
|
||||
if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
|
||||
if (typeof option == 'string') data[option].call($this)
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.dropdown.Constructor = Dropdown
|
||||
|
||||
|
||||
// DROPDOWN NO CONFLICT
|
||||
// ====================
|
||||
|
||||
$.fn.dropdown.noConflict = function () {
|
||||
$.fn.dropdown = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
// APPLY TO STANDARD DROPDOWN ELEMENTS
|
||||
// ===================================
|
||||
|
||||
$(document)
|
||||
.on('click.bs.dropdown.data-api', clearMenus)
|
||||
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
||||
.on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
|
||||
.on('keydown.bs.dropdown.data-api', toggle + ', [role="menu"], [role="listbox"]', Dropdown.prototype.keydown)
|
||||
|
||||
}(jQuery);
|
||||
@@ -1,5 +1,5 @@
|
||||
/* ===========================================================
|
||||
* Bootstrap: fileinput.js v3.1.0
|
||||
* Bootstrap: fileinput.js v3.1.1
|
||||
* http://jasny.github.com/bootstrap/javascript/#fileinput
|
||||
* ===========================================================
|
||||
* Copyright 2012-2014 Arnold Daniels
|
||||
@@ -61,7 +61,11 @@
|
||||
|
||||
Fileinput.prototype.change = function(e) {
|
||||
if (e.target.files === undefined) e.target.files = e.target && e.target.value ? [ {name: e.target.value.replace(/^.+\\/, '')} ] : []
|
||||
if (e.target.files.length === 0) return
|
||||
|
||||
if (e.target.files.length === 0) {
|
||||
this.clear()
|
||||
return
|
||||
}
|
||||
|
||||
this.$hidden.val('')
|
||||
this.$hidden.attr('name', '')
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/* ========================================================================
|
||||
* Bootstrap: offcanvas.js v3.1.0
|
||||
* Bootstrap: offcanvas.js v3.1.1
|
||||
* http://jasny.github.io/bootstrap/javascript/#offcanvas
|
||||
*
|
||||
* Based on Boostrap collapse.js by Twitter, Inc.
|
||||
* ========================================================================
|
||||
* Copyright 2013-2014 Arnold Daniels
|
||||
*
|
||||
@@ -28,6 +26,7 @@
|
||||
this.$element = $(element)
|
||||
this.options = $.extend({}, OffCanvas.DEFAULTS, options)
|
||||
this.state = null
|
||||
this.placement = null
|
||||
|
||||
if (this.options.recalc) {
|
||||
this.calcClone()
|
||||
@@ -42,13 +41,14 @@
|
||||
|
||||
OffCanvas.DEFAULTS = {
|
||||
toggle: true,
|
||||
placement: 'left',
|
||||
placement: 'auto',
|
||||
autohide: true,
|
||||
recalc: true
|
||||
recalc: true,
|
||||
disableScrolling: true
|
||||
}
|
||||
|
||||
OffCanvas.prototype.offset = function () {
|
||||
switch (this.options.placement) {
|
||||
switch (this.placement) {
|
||||
case 'left':
|
||||
case 'right': return this.$element.outerWidth()
|
||||
case 'top':
|
||||
@@ -57,26 +57,31 @@
|
||||
}
|
||||
|
||||
OffCanvas.prototype.calcPlacement = function () {
|
||||
var horizontal = $(window).width() / this.$element.width(),
|
||||
vertical = $(window).height() / this.$element.height()
|
||||
|
||||
if (this.options.placement !== 'auto') {
|
||||
this.placement = this.options.placement
|
||||
return
|
||||
}
|
||||
|
||||
if (!this.$element.hasClass('in')) {
|
||||
this.$element.css('visiblity', 'hidden !important').addClass('in')
|
||||
}
|
||||
|
||||
var horizontal = $(window).width() / this.$element.width()
|
||||
var vertical = $(window).height() / this.$element.height()
|
||||
|
||||
var element = this.$element
|
||||
function ab(a, b) {
|
||||
if (element.css(b) === 'auto') return a
|
||||
if (element.css(a) === 'auto') return b
|
||||
|
||||
var size_a = parseInt(element.css(a), 10),
|
||||
size_b = parseInt(element.css(b), 10)
|
||||
var size_a = parseInt(element.css(a), 10)
|
||||
var size_b = parseInt(element.css(b), 10)
|
||||
|
||||
return size_a > size_b ? b : a
|
||||
}
|
||||
|
||||
this.options.placement = horizontal > vertical ? ab('left', 'right') : ab('top', 'bottom')
|
||||
|
||||
this.placement = horizontal >= vertical ? ab('left', 'right') : ab('top', 'bottom')
|
||||
|
||||
if (this.$element.css('visibility') === 'hidden !important') {
|
||||
this.$element.removeClass('in').css('visiblity', '')
|
||||
}
|
||||
@@ -106,12 +111,12 @@
|
||||
// Use jQuery animation if CSS transitions aren't supported
|
||||
if (!$.support.transition) {
|
||||
var anim = {}
|
||||
anim[this.options.placement] = "+=" + offset
|
||||
anim[this.placement] = "+=" + offset
|
||||
return elements.animate(anim, 350, callback)
|
||||
}
|
||||
|
||||
var placement = this.options.placement,
|
||||
opposite = this.opposite(placement)
|
||||
var placement = this.placement
|
||||
var opposite = this.opposite(placement)
|
||||
|
||||
elements.each(function() {
|
||||
if ($(this).css(placement) !== 'auto')
|
||||
@@ -128,7 +133,7 @@
|
||||
|
||||
OffCanvas.prototype.disableScrolling = function() {
|
||||
var bodyWidth = $('body').width()
|
||||
var prop = 'padding-' + this.opposite(this.options.placement)
|
||||
var prop = 'padding-' + this.opposite(this.placement)
|
||||
|
||||
if ($('body').data('offcanvas-style') === undefined) $('body').data('offcanvas-style', $('body').attr('style'))
|
||||
|
||||
@@ -150,17 +155,22 @@
|
||||
this.$element.trigger(startEvent)
|
||||
if (startEvent.isDefaultPrevented()) return
|
||||
|
||||
if (this.options.placement === 'auto') this.calcPlacement()
|
||||
|
||||
this.state = 'sliding'
|
||||
|
||||
this.state = 'slide-in'
|
||||
this.calcPlacement();
|
||||
|
||||
var elements = this.getCanvasElements()
|
||||
var offset = this.offset(),
|
||||
placement = this.options.placement,
|
||||
opposite = this.opposite(placement)
|
||||
var placement = this.placement
|
||||
var opposite = this.opposite(placement)
|
||||
var offset = this.offset()
|
||||
|
||||
if (elements.index(this.$element) !== -1) {
|
||||
$(this.$element).data('offcanvas-style', $(this.$element).attr('style') || '')
|
||||
this.$element.css(placement, -1 * offset)
|
||||
this.$element.css(placement); // Workaround: Need to get the CSS property for it to be applied before the next line of code
|
||||
}
|
||||
|
||||
elements.addClass('canvas-sliding').each(function() {
|
||||
$(this).data('offcanvas-style', $(this).attr('style') || '')
|
||||
if ($(this).data('offcanvas-style') === undefined) $(this).data('offcanvas-style', $(this).attr('style') || '')
|
||||
if ($(this).css('position') === 'static') $(this).css('position', 'relative')
|
||||
if (($(this).css(placement) === 'auto' || $(this).css(placement) === '0px') &&
|
||||
($(this).css(opposite) === 'auto' || $(this).css(opposite) === '0px')) {
|
||||
@@ -168,11 +178,11 @@
|
||||
}
|
||||
})
|
||||
|
||||
if (elements.index(this.$element) !== -1) this.$element.css(placement, -1 * offset)
|
||||
|
||||
this.disableScrolling()
|
||||
if (this.options.disableScrolling) this.disableScrolling()
|
||||
|
||||
var complete = function () {
|
||||
if (this.state != 'slide-in') return
|
||||
|
||||
this.state = 'slid'
|
||||
|
||||
elements.removeClass('canvas-sliding').addClass('canvas-slid')
|
||||
@@ -192,18 +202,22 @@
|
||||
this.$element.trigger(startEvent)
|
||||
if (startEvent.isDefaultPrevented()) return
|
||||
|
||||
this.state = 'sliding'
|
||||
this.state = 'slide-out'
|
||||
|
||||
var elements = $('.canvas-slid')
|
||||
var placement = this.placement
|
||||
var offset = -1 * this.offset()
|
||||
|
||||
var complete = function () {
|
||||
if (this.state != 'slide-out') return
|
||||
|
||||
this.state = null
|
||||
|
||||
this.placement = null
|
||||
|
||||
this.$element.removeClass('in')
|
||||
|
||||
elements.removeClass('canvas-sliding')
|
||||
elements.add('body').each(function() {
|
||||
elements.add(this.$element).add('body').each(function() {
|
||||
$(this).attr('style', $(this).data('offcanvas-style')).removeData('offcanvas-style')
|
||||
})
|
||||
|
||||
@@ -218,7 +232,7 @@
|
||||
}
|
||||
|
||||
OffCanvas.prototype.toggle = function () {
|
||||
if (this.state === 'sliding') return
|
||||
if (this.state === 'slide-in' || this.state === 'slide-out') return
|
||||
this[this.state === 'slid' ? 'hide' : 'show']()
|
||||
}
|
||||
|
||||
@@ -230,17 +244,18 @@
|
||||
}
|
||||
|
||||
OffCanvas.prototype.recalc = function () {
|
||||
if (this.state() !== 'slid' || this.$calcClone.css('display') === 'none') return
|
||||
if (this.$calcClone.css('display') === 'none' || (this.state !== 'slid' && this.state !== 'slide-in')) return
|
||||
|
||||
var offset = -1 * this.offset()
|
||||
this.state = null
|
||||
this.placement = null
|
||||
var elements = this.getCanvasElements()
|
||||
|
||||
var placement = this.options.placement
|
||||
this.getCanvasElements().each(function() {
|
||||
$(this).css(placement, (parseInt($(this).css(placement), 10) || 0) + offset)
|
||||
}).removeClass('canvas-slid')
|
||||
this.$element.removeClass('in')
|
||||
|
||||
$('body').css('overflow', '')
|
||||
this.$element.css(placement, '').removeClass('in canvas-slid')
|
||||
elements.removeClass('canvas-slid')
|
||||
elements.add(this.$element).add('body').each(function() {
|
||||
$(this).attr('style', $(this).data('offcanvas-style')).removeData('offcanvas-style')
|
||||
})
|
||||
}
|
||||
|
||||
OffCanvas.prototype.autohide = function (e) {
|
||||
@@ -256,10 +271,10 @@
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
var data = $this.data('bs.offcanvas')
|
||||
var options = $.extend({}, OffCanvas.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
||||
var options = $.extend({}, OffCanvas.DEFAULTS, $this.data(), typeof option === 'object' && option)
|
||||
|
||||
if (!data) $this.data('bs.offcanvas', (data = new OffCanvas(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
if (typeof option === 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
54
less/dropdown-submenu.less
Normal file
54
less/dropdown-submenu.less
Normal file
@@ -0,0 +1,54 @@
|
||||
// Dropdown-submenu.less
|
||||
// Multi level dropdowns
|
||||
//
|
||||
// Based on work by Maks Surguy (https://twitter.com/msurguy)
|
||||
// http://bootsnipp.com/snippets/featured/multi-level-dropdown-menu-bs3
|
||||
// ------------------------------------------------
|
||||
|
||||
.dropdown-menu .dropdown {
|
||||
position: relative;
|
||||
|
||||
> .dropdown-menu {
|
||||
top: 0;
|
||||
left: 100%;
|
||||
margin-top: -6px;
|
||||
margin-left: -1px;
|
||||
-webkit-border-radius: 0 6px 6px 6px;
|
||||
-moz-border-radius: 0 6px 6px;
|
||||
border-radius: 0 6px 6px 6px;
|
||||
}
|
||||
|
||||
&.open > .dropdown-menu {
|
||||
display: block;
|
||||
}
|
||||
|
||||
> a:after {
|
||||
display: block;
|
||||
content: " ";
|
||||
float: right;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-color: transparent;
|
||||
border-style: solid;
|
||||
border-width: 5px 0 5px 5px;
|
||||
border-left-color: #ccc;
|
||||
margin-top: 5px;
|
||||
margin-right: -10px;
|
||||
}
|
||||
|
||||
&.open > a:after {
|
||||
border-left-color: #fff;
|
||||
}
|
||||
|
||||
&.pull-left {
|
||||
float: none;
|
||||
|
||||
> .dropdown-menu {
|
||||
left: -100%;
|
||||
margin-left: 10px;
|
||||
-webkit-border-radius: 6px 0 6px 6px;
|
||||
-moz-border-radius: 6px 0 6px 6px;
|
||||
border-radius: 6px 0 6px 6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,7 @@
|
||||
opacity: 0;
|
||||
filter: alpha(opacity=0);
|
||||
transform: translate(-300px, 0) scale(4);
|
||||
-webkit-transform: translate(-300px, 0) scale(4);
|
||||
font-size: 23px;
|
||||
height: 100%;
|
||||
direction: ltr;
|
||||
@@ -63,16 +64,22 @@
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
.fileinput.input-group {
|
||||
display: table;
|
||||
}
|
||||
|
||||
// Not 100% correct, but helps in typical use case
|
||||
.fileinput-new.input-group .btn-file,
|
||||
.fileinput-new .input-group .btn-file {
|
||||
border-radius: 0 @border-radius-base @border-radius-base 0;
|
||||
}
|
||||
.fileinput-new .input-group .btn-file.btn-xs,
|
||||
.fileinput-new .input-group .btn-file.btn-sm {
|
||||
border-radius: 0 @border-radius-small @border-radius-small 0;
|
||||
}
|
||||
.fileinput-new .input-group .btn-file.btn-lg {
|
||||
border-radius: 0 @border-radius-large @border-radius-large 0;
|
||||
|
||||
&.btn-xs,
|
||||
&.btn-sm {
|
||||
border-radius: 0 @border-radius-small @border-radius-small 0;
|
||||
}
|
||||
&.btn-lg {
|
||||
border-radius: 0 @border-radius-large @border-radius-large 0;
|
||||
}
|
||||
}
|
||||
|
||||
.form-group.has-warning .fileinput {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
// Smooth sizing container
|
||||
// -------------------------
|
||||
|
||||
@media (min-width: 1px) {
|
||||
.container-smooth {
|
||||
max-width: @container-lg;
|
||||
.container-smooth {
|
||||
max-width: @container-lg;
|
||||
|
||||
@media (min-width: 1px) {
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
@import "button-labels.less";
|
||||
|
||||
// Components
|
||||
@import "dropdown-submenu.less";
|
||||
@import "nav-tab-alignment.less";
|
||||
@import "navmenu.less";
|
||||
@import "alerts-fixed.less";
|
||||
|
||||
@@ -26,11 +26,14 @@
|
||||
border-radius: 0;
|
||||
}
|
||||
.navmenu-fixed-left,
|
||||
.navbar-offcanvas {
|
||||
.navbar-offcanvas.navmenu-fixed-left {
|
||||
left: 0;
|
||||
right: auto;
|
||||
border-width: 0 1px 0 0;
|
||||
}
|
||||
.navmenu-fixed-right {
|
||||
.navmenu-fixed-right,
|
||||
.navbar-offcanvas {
|
||||
left: auto;
|
||||
right: 0;
|
||||
border-width: 0 0 0 1px;
|
||||
}
|
||||
|
||||
18
package.json
18
package.json
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jasny-bootstrap",
|
||||
"description": "Additional features and components for Bootstrap",
|
||||
"version": "3.1.0",
|
||||
"version": "3.1.1",
|
||||
"keywords": [
|
||||
"bootstrap",
|
||||
"css"
|
||||
@@ -31,24 +31,24 @@
|
||||
"grunt-banner": "~0.2.0",
|
||||
"grunt-contrib-clean": "~0.5.0",
|
||||
"grunt-contrib-concat": "~0.3.0",
|
||||
"grunt-contrib-connect": "~0.6.0",
|
||||
"grunt-contrib-connect": "~0.7.0",
|
||||
"grunt-contrib-copy": "~0.5.0",
|
||||
"grunt-contrib-csslint": "~0.2.0",
|
||||
"grunt-contrib-cssmin": "~0.7.0",
|
||||
"grunt-contrib-jade": "~0.9.1",
|
||||
"grunt-contrib-cssmin": "~0.9.0",
|
||||
"grunt-contrib-jade": "~0.11.0",
|
||||
"grunt-contrib-jshint": "~0.8.0",
|
||||
"grunt-contrib-less": "~0.9.0",
|
||||
"grunt-contrib-less": "~0.10.0",
|
||||
"grunt-contrib-qunit": "~0.4.0",
|
||||
"grunt-contrib-uglify": "~0.3.0",
|
||||
"grunt-contrib-uglify": "~0.4.0",
|
||||
"grunt-contrib-watch": "~0.5.3",
|
||||
"grunt-csscomb": "~2.0.1",
|
||||
"grunt-exec": "0.4.2",
|
||||
"grunt-exec": "~0.4.2",
|
||||
"grunt-html-validation": "~0.1.13",
|
||||
"grunt-jekyll": "~0.4.1",
|
||||
"grunt-jscs-checker": "~0.3.0",
|
||||
"grunt-jscs-checker": "~0.4.0",
|
||||
"grunt-saucelabs": "~5.0.0",
|
||||
"grunt-sed": "~0.1.1",
|
||||
"load-grunt-tasks": "~0.3.0",
|
||||
"load-grunt-tasks": "~0.4.0",
|
||||
"markdown": "~0.5.0"
|
||||
},
|
||||
"jspm": {
|
||||
|
||||
Reference in New Issue
Block a user