Skip to content

Commit

Permalink
version bump > 1.0.6 for #13
Browse files Browse the repository at this point in the history
  • Loading branch information
clineamb committed May 19, 2016
1 parent 80b23d2 commit 1ac7d7d
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 223 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bootstrap-drawer",
"version": "1.0.5",
"version": "1.0.6",
"authors": [
"Caroline Amaba <[email protected]>"
],
Expand Down
2 changes: 1 addition & 1 deletion dist/js/drawer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ========================================================================
* Bootstrap: drawer.js v1.0.5
* Bootstrap: drawer.js v1.0.6
# Heavily based on collapse, but had to change the name to "fold" to
# avoid transition conflicts.
* ========================================================================
Expand Down
4 changes: 2 additions & 2 deletions docs/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ <h2 id="requirements">Requirements</h2>
<h3 id="download">Download</h3>
<p><code>bower install bootstrap-drawer</code> or <code>npm install bootstrap-drawer</code></p>
<p>You can also find all the release on the <a href="https://github.com/clineamb/bootstrap-drawer/releases" target="_blank">GitHub repo releases page</a>. For your convenience, here are some links to the latest releases:</p>
<p><a href="http://github.com/clineamb/bootstrap-drawer/releases/latest" target="_blank" class="btn btn-lg btn-primary"><i class="fa fa-github-alt"></i> Get Latest Vesion (1.0.5)</a>
<a href="http://github.com/clineamb/bootstrap-drawer/archive/1.0.5.zip" target="_blank" class="btn btn-lg btn-primary"><i class="fa fa-archive"></i> Download bootstrap-drawer-1.0.5.zip</a></p>
<p><a href="http://github.com/clineamb/bootstrap-drawer/releases/latest" target="_blank" class="btn btn-lg btn-primary"><i class="fa fa-github-alt"></i> Get Latest Vesion (1.0.6)</a>
<a href="http://github.com/clineamb/bootstrap-drawer/archive/1.0.6.zip" target="_blank" class="btn btn-lg btn-primary"><i class="fa fa-archive"></i> Download bootstrap-drawer-1.0.6.zip</a></p>
<hr>
<h2 id="basic-setup">Basic Setup</h2>
<p>If you simply just want to quickly use bootstrap-drawer with Bootstrap, you just need to include <code>dist/bootstrap-drawer.css</code> after Bootstrap, and then include any other files after that.</p>
Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ I've looked around for fast-and-easy ways of implementing this constantly (and c

You can also find all the release on the <a href="https://github.com/clineamb/bootstrap-drawer/releases" target="_blank">GitHub repo releases page</a>. For your convenience, here are some links to the latest releases:

<a href="http://github.com/clineamb/bootstrap-drawer/releases/latest" target="_blank" class="btn btn-lg btn-primary"><i class="fa fa-github-alt"></i> Get Latest Vesion (1.0.5)</a>
<a href="http://github.com/clineamb/bootstrap-drawer/archive/1.0.5.zip" target="_blank" class="btn btn-lg btn-primary"><i class="fa fa-archive"></i> Download bootstrap-drawer-1.0.5.zip</a>
<a href="http://github.com/clineamb/bootstrap-drawer/releases/latest" target="_blank" class="btn btn-lg btn-primary"><i class="fa fa-github-alt"></i> Get Latest Vesion (1.0.6)</a>
<a href="http://github.com/clineamb/bootstrap-drawer/archive/1.0.6.zip" target="_blank" class="btn btn-lg btn-primary"><i class="fa fa-archive"></i> Download bootstrap-drawer-1.0.6.zip</a>

----------

Expand Down
213 changes: 0 additions & 213 deletions example/drawer.js
Original file line number Diff line number Diff line change
@@ -1,213 +0,0 @@
/* ========================================================================
* Bootstrap: drawer.js v1.0.6
# Heavily based on collapse, but had to change the name to "fold" to
# avoid transition conflicts.
* ========================================================================
*/


(function ($) {
'use strict';

// OFF CANVAS PUBLIC CLASS DEFINITION
// ================================

var Drawer = function (element, options) {
this.$element = $(element)
this.options = $.extend({}, Drawer.DEFAULTS, options)
this.$trigger = $(this.options.trigger).filter('[href="#' + element.id + '"], [data-target="#' + element.id + '"]')
this.transitioning = null

if (this.options.parent) {
this.$parent = this.getParent()
} else {
this.addAriaAndDrawerdClass(this.$element, this.$trigger)
}

if (this.options.toggle) this.toggle()
}

Drawer.VERSION = '3.3.2'

Drawer.TRANSITION_DURATION = 350

Drawer.DEFAULTS = {
toggle: true,
trigger: '[data-toggle="drawer"]'
}

Drawer.prototype.dimension = function () {
var isRight = this.$element.hasClass('drawer-right')
return isRight ? 'margin-right' : 'margin-left'
}

Drawer.prototype.show = function () {
if (this.transitioning || this.$element.hasClass('open')) return

var activesData
var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')

if (actives && actives.length) {
activesData = actives.data('bs.drawer')
if (activesData && activesData.transitioning) return
}

var startEvent = $.Event('show.bs.drawer')
this.$element.trigger(startEvent)
if (startEvent.isDefaultPrevented()) return

if (actives && actives.length) {
Plugin.call(actives, 'hide')
activesData || actives.data('bs.drawer', null)
}

var dimension = this.dimension()

this.$element
.addClass('folding').css(dimension, 0)
.attr('aria-expanded', true)

this.$trigger
.removeClass('folded')
.attr('aria-expanded', true)

this.transitioning = 1

var complete = function () {
this.$element
.removeClass('folding')
.addClass('fold open').css(dimension, '')
this.transitioning = 0
this.$element
.trigger('shown.bs.drawer')
}

if (!$.support.transition) {
return complete.call(this)
} else {
this.transEventName = $.support.transition.end;
}

this.$element
.one(this.transEventName, $.proxy(complete, this))
.emulateTransitionEnd(Drawer.TRANSITION_DURATION).css(dimension, 0)
}

Drawer.prototype.hide = function () {
if (this.transitioning || !this.$element.hasClass('open')) return

var startEvent = $.Event('hide.bs.drawer')
this.$element.trigger(startEvent)
if (startEvent.isDefaultPrevented()) return

var dimension = this.dimension()

this.$element
.addClass('folding')
.removeClass('open')
.attr('aria-expanded', false)

this.$trigger
.addClass('folded')
.attr('aria-expanded', false)

this.transitioning = 1

var complete = function () {
this.transitioning = 0
this.$element
.removeClass('folding')
.addClass('fold')
.trigger('hidden.bs.drawer')
}

if (!$.support.transition) {
return complete.call(this)
} else {
this.transEventName = $.support.transition.end;
}

this.$element
.css(dimension, '')
.one(this.transEventName, $.proxy(complete, this))
.emulateTransitionEnd(Drawer.TRANSITION_DURATION)
}

Drawer.prototype.toggle = function () {
this[this.$element.hasClass('open') ? 'hide' : 'show']()
}

Drawer.prototype.getParent = function () {
return $(this.options.parent)
.find('[data-toggle="drawer"][data-parent="' + this.options.parent + '"]')
.each($.proxy(function (i, element) {
var $element = $(element)
this.addAriaAndDrawerdClass(getTargetFromTrigger($element), $element)
}, this))
.end()
}

Drawer.prototype.addAriaAndDrawerdClass = function ($element, $trigger) {
var isOpen = $element.hasClass('open')

$element.attr('aria-expanded', isOpen)
$trigger
.toggleClass('folded', !isOpen)
.attr('aria-expanded', isOpen)
}

function getTargetFromTrigger($trigger) {
var href
var target = $trigger.attr('data-target')
|| (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7

return $(target)
}


// OFFCANVAS PLUGIN DEFINITION
// ==========================

function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.drawer')
var options = $.extend({}, Drawer.DEFAULTS, $this.data(), typeof option == 'object' && option)

if (!data && options.toggle && option == 'show') options.toggle = false
if (!data) $this.data('bs.drawer', (data = new Drawer(this, options)))
if (typeof option == 'string') data[option]()
})
}

var old = $.fn.fold

$.fn.drawer = Plugin
$.fn.drawer.Constructor = Drawer


// OFFCANVAS NO CONFLICT
// ====================

$.fn.drawer.noConflict = function () {
$.fn.fold = old
return this
}


// OFFCANVAS DATA-API
// =================

$(document).on('click.bs.drawer.data-api', '[data-toggle="drawer"]', function (e) {
var $this = $(this)

if (!$this.attr('data-target')) e.preventDefault()

var $target = getTargetFromTrigger($this)
var data = $target.data('bs.drawer')
var option = data ? 'toggle' : $.extend({}, $this.data(), { trigger: this })

Plugin.call($target, option)
})

})(window.jQuery || {});
2 changes: 1 addition & 1 deletion js/drawer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ========================================================================
* Bootstrap: drawer.js v1.0.5
* Bootstrap: drawer.js v1.0.6
# Heavily based on collapse, but had to change the name to "fold" to
# avoid transition conflicts.
* ========================================================================
Expand Down
1 change: 0 additions & 1 deletion less/drawer.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* ========================================================================
*/


//
// Off-Canvas
// --------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bootstrap-drawer",
"version": "1.0.5",
"version": "1.0.6",
"description": "A Bootstrap add-on to create drawer (off-canvas) styled navigation",
"main": "index.js",
"directories": {
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ goes off screen. This is an add-on to the core Bootstrap framework that adds va

This Readme is actually a quick start. [Check out the full documentation](http://clineamb.github.io/bootstrap-drawer) for detailed usage and style guide.

**Version:** 1.0.5
**Version:** 1.0.6

## Requirements

Expand Down

0 comments on commit 1ac7d7d

Please sign in to comment.