Commit 5e5965ca authored by Jacob Thornton's avatar Jacob Thornton

Merge branch 'accessibility' into 2.1.0-wip

Conflicts:
	docs/assets/js/bootstrap.min.js
	docs/javascript.html
	docs/templates/pages/javascript.mustache
parents ebc69356 b1d7c340
...@@ -2384,12 +2384,17 @@ table .span24 { ...@@ -2384,12 +2384,17 @@ table .span24 {
margin-left: 2px; margin-left: 2px;
} }
.dropdown:hover .caret, .dropdown a:focus .caret,
.dropdown a:hover .caret,
.open .caret { .open .caret {
opacity: 1; opacity: 1;
filter: alpha(opacity=100); filter: alpha(opacity=100);
} }
.navbar .nav .open > a {
color: #ffffff;
}
.dropdown-menu { .dropdown-menu {
position: absolute; position: absolute;
top: 100%; top: 100%;
...@@ -2443,11 +2448,13 @@ table .span24 { ...@@ -2443,11 +2448,13 @@ table .span24 {
} }
.dropdown-menu li > a:hover, .dropdown-menu li > a:hover,
.dropdown-menu li > a:focus,
.dropdown-menu .active > a, .dropdown-menu .active > a,
.dropdown-menu .active > a:hover { .dropdown-menu .active > a:hover {
color: #ffffff; color: #ffffff;
text-decoration: none; text-decoration: none;
background-color: #0088cc; background-color: #0088cc;
outline: 0;
} }
.open { .open {
...@@ -3810,6 +3817,7 @@ input[type="submit"].btn.btn-mini { ...@@ -3810,6 +3817,7 @@ input[type="submit"].btn.btn-mini {
margin: 0; margin: 0;
} }
.navbar .nav > li > a:focus,
.navbar .nav > li > a:hover { .navbar .nav > li > a:hover {
color: #ffffff; color: #ffffff;
text-decoration: none; text-decoration: none;
...@@ -3817,7 +3825,8 @@ input[type="submit"].btn.btn-mini { ...@@ -3817,7 +3825,8 @@ input[type="submit"].btn.btn-mini {
} }
.navbar .nav .active > a, .navbar .nav .active > a,
.navbar .nav .active > a:hover { .navbar .nav .active > a:hover,
.navbar .nav .active > a:focus {
color: #ffffff; color: #ffffff;
text-decoration: none; text-decoration: none;
background-color: #222222; background-color: #222222;
...@@ -3947,6 +3956,7 @@ input[type="submit"].btn.btn-mini { ...@@ -3947,6 +3956,7 @@ input[type="submit"].btn.btn-mini {
background-color: transparent; background-color: transparent;
} }
.navbar .nav li.dropdown.active > .dropdown-toggle:focus,
.navbar .nav li.dropdown.active > .dropdown-toggle:hover { .navbar .nav li.dropdown.active > .dropdown-toggle:hover {
color: #ffffff; color: #ffffff;
} }
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
/* DROPDOWN CLASS DEFINITION /* DROPDOWN CLASS DEFINITION
* ========================= */ * ========================= */
var toggle = '[data-toggle="dropdown"]' var toggle = '[data-toggle=dropdown]'
, Dropdown = function (element) { , Dropdown = function (element) {
var $el = $(element).on('click.dropdown.data-api', this.toggle) var $el = $(element).on('click.dropdown.data-api', this.toggle)
$('html').on('click.dropdown.data-api', function () { $('html').on('click.dropdown.data-api', function () {
...@@ -41,34 +41,82 @@ ...@@ -41,34 +41,82 @@
, toggle: function (e) { , toggle: function (e) {
var $this = $(this) var $this = $(this)
, $parent , $parent
, selector
, isActive , isActive
if ($this.is('.disabled, :disabled')) return if ($this.is('.disabled, :disabled')) return
selector = $this.attr('data-target') $parent = getParent($this)
if (!selector) { isActive = $parent.hasClass('open')
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 clearMenus()
if (!isActive) {
$parent.toggleClass('open')
$this.focus()
} }
$parent = $(selector) return false
$parent.length || ($parent = $this.parent()) }
, keydown: function (e) {
var $this
, $items
, $active
, $parent
, isActive
, index
if (!/(38|40|27)/.test(e.keyCode)) return
$this = $(this)
e.preventDefault()
e.stopPropagation()
if ($this.is('.disabled, :disabled')) return
$parent = getParent($this)
isActive = $parent.hasClass('open') isActive = $parent.hasClass('open')
clearMenus() if (!isActive || (isActive && e.keyCode == 27)) return $this.click()
if (!isActive) $parent.toggleClass('open') $items = $('[role=menu] li:not(.divider) a', $parent)
return false if (!$items.length) return
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)
.focus()
} }
} }
function clearMenus() { function clearMenus() {
$(toggle).parent().removeClass('open') getParent($(toggle))
.removeClass('open')
}
function getParent($this) {
var selector = $this.attr('data-target')
, $parent
if (!selector) {
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
}
$parent = $(selector)
$parent.length || ($parent = $this.parent())
return $parent
} }
...@@ -91,10 +139,12 @@ ...@@ -91,10 +139,12 @@
* =================================== */ * =================================== */
$(function () { $(function () {
$('html').on('click.dropdown.data-api', clearMenus) $('html')
.on('click.dropdown.data-api', clearMenus)
$('body') $('body')
.on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() }) .on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
.on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle) .on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
.on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
}) })
}(window.jQuery); }(window.jQuery);
\ No newline at end of file
...@@ -52,8 +52,9 @@ ...@@ -52,8 +52,9 @@
this.isShown = true this.isShown = true
escape.call(this) this.escape()
backdrop.call(this, function () {
this.backdrop(function () {
var transition = $.support.transition && that.$element.hasClass('fade') var transition = $.support.transition && that.$element.hasClass('fade')
if (!that.$element.parent().length) { if (!that.$element.parent().length) {
...@@ -69,6 +70,8 @@ ...@@ -69,6 +70,8 @@
that.$element.addClass('in') that.$element.addClass('in')
that.enforceFocus()
transition ? transition ?
that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) : that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
that.$element.trigger('shown') that.$element.trigger('shown')
...@@ -91,90 +94,96 @@ ...@@ -91,90 +94,96 @@
$('body').removeClass('modal-open') $('body').removeClass('modal-open')
escape.call(this) this.escape()
$(document).off('focusin.modal')
this.$element.removeClass('in') this.$element.removeClass('in')
$.support.transition && this.$element.hasClass('fade') ? $.support.transition && this.$element.hasClass('fade') ?
hideWithTransition.call(this) : this.hideWithTransition() :
hideModal.call(this) this.hideModal()
} }
} , enforceFocus: function () {
var that = this
$(document).on('focusin.modal', function (e) {
/* MODAL PRIVATE METHODS if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
* ===================== */ that.$element.focus()
}
function hideWithTransition() { })
var that = this }
, timeout = setTimeout(function () {
that.$element.off($.support.transition.end)
hideModal.call(that)
}, 500)
this.$element.one($.support.transition.end, function () { , escape: function () {
clearTimeout(timeout) var that = this
hideModal.call(that) if (this.isShown && this.options.keyboard) {
}) $(document).on('keyup.dismiss.modal', function ( e ) {
} e.which == 27 && that.hide()
})
} else if (!this.isShown) {
$(document).off('keyup.dismiss.modal')
}
}
function hideModal(that) { , hideWithTransition: function () {
this.$element var that = this
.hide() , timeout = setTimeout(function () {
.trigger('hidden') that.$element.off($.support.transition.end)
that.hideModal()
}, 500)
this.$element.one($.support.transition.end, function () {
clearTimeout(timeout)
that.hideModal()
})
}
backdrop.call(this) , hideModal: function (that) {
} this.$element
.hide()
.trigger('hidden')
function backdrop(callback) { this.backdrop()
var that = this }
, animate = this.$element.hasClass('fade') ? 'fade' : ''
if (this.isShown && this.options.backdrop) { , removeBackdrop: function () {
var doAnimate = $.support.transition && animate this.$backdrop.remove()
this.$backdrop = null
}
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />') , backdrop: function (callback) {
.appendTo(document.body) var that = this
, animate = this.$element.hasClass('fade') ? 'fade' : ''
if (this.options.backdrop != 'static') { if (this.isShown && this.options.backdrop) {
this.$backdrop.click($.proxy(this.hide, this)) var doAnimate = $.support.transition && animate
}
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
.appendTo(document.body)
this.$backdrop.addClass('in') if (this.options.backdrop != 'static') {
this.$backdrop.click($.proxy(this.hide, this))
}
doAnimate ? if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
this.$backdrop.one($.support.transition.end, callback) :
callback()
} else if (!this.isShown && this.$backdrop) { this.$backdrop.addClass('in')
this.$backdrop.removeClass('in')
$.support.transition && this.$element.hasClass('fade')? doAnimate ?
this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) : this.$backdrop.one($.support.transition.end, callback) :
removeBackdrop.call(this) callback()
} else if (callback) { } else if (!this.isShown && this.$backdrop) {
callback() this.$backdrop.removeClass('in')
}
}
function removeBackdrop() { $.support.transition && this.$element.hasClass('fade')?
this.$backdrop.remove() this.$backdrop.one($.support.transition.end, $.proxy(this.removeBackdrop, this)) :
this.$backdrop = null this.removeBackdrop()
}
function escape() { } else if (callback) {
var that = this callback()
if (this.isShown && this.options.keyboard) { }
$(document).on('keyup.dismiss.modal', function ( e ) { }
e.which == 27 && that.hide()
})
} else if (!this.isShown) {
$(document).off('keyup.dismiss.modal')
}
} }
......
...@@ -594,7 +594,7 @@ ...@@ -594,7 +594,7 @@
/* DROPDOWN CLASS DEFINITION /* DROPDOWN CLASS DEFINITION
* ========================= */ * ========================= */
var toggle = '[data-toggle="dropdown"]' var toggle = '[data-toggle=dropdown]'
, Dropdown = function (element) { , Dropdown = function (element) {
var $el = $(element).on('click.dropdown.data-api', this.toggle) var $el = $(element).on('click.dropdown.data-api', this.toggle)
$('html').on('click.dropdown.data-api', function () { $('html').on('click.dropdown.data-api', function () {
...@@ -609,34 +609,82 @@ ...@@ -609,34 +609,82 @@
, toggle: function (e) { , toggle: function (e) {
var $this = $(this) var $this = $(this)
, $parent , $parent
, selector
, isActive , isActive
if ($this.is('.disabled, :disabled')) return if ($this.is('.disabled, :disabled')) return
selector = $this.attr('data-target') $parent = getParent($this)
if (!selector) { isActive = $parent.hasClass('open')
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 clearMenus()
if (!isActive) {
$parent.toggleClass('open')
$this.focus()
} }
$parent = $(selector) return false
$parent.length || ($parent = $this.parent()) }
, keydown: function (e) {
var $this
, $items
, $active
, $parent
, isActive
, index
if (!/(38|40|27)/.test(e.keyCode)) return
$this = $(this)
e.preventDefault()
e.stopPropagation()
if ($this.is('.disabled, :disabled')) return
$parent = getParent($this)
isActive = $parent.hasClass('open') isActive = $parent.hasClass('open')
clearMenus() if (!isActive || (isActive && e.keyCode == 27)) return $this.click()
if (!isActive) $parent.toggleClass('open') $items = $('[role=menu] li:not(.divider) a', $parent)
return false if (!$items.length) return
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)
.focus()
} }
} }
function clearMenus() { function clearMenus() {
$(toggle).parent().removeClass('open') getParent($(toggle))
.removeClass('open')
}
function getParent($this) {
var selector = $this.attr('data-target')
, $parent
if (!selector) {
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
}
$parent = $(selector)
$parent.length || ($parent = $this.parent())
return $parent
} }
...@@ -659,10 +707,12 @@ ...@@ -659,10 +707,12 @@
* =================================== */ * =================================== */
$(function () { $(function () {
$('html').on('click.dropdown.data-api', clearMenus) $('html')
.on('click.dropdown.data-api', clearMenus)
$('body') $('body')
.on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() }) .on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
.on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle) .on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
.on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
}) })
}(window.jQuery);/* ========================================================= }(window.jQuery);/* =========================================================
...@@ -719,8 +769,9 @@ ...@@ -719,8 +769,9 @@
this.isShown = true this.isShown = true
escape.call(this) this.escape()
backdrop.call(this, function () {
this.backdrop(function () {
var transition = $.support.transition && that.$element.hasClass('fade') var transition = $.support.transition && that.$element.hasClass('fade')
if (!that.$element.parent().length) { if (!that.$element.parent().length) {
...@@ -736,6 +787,8 @@ ...@@ -736,6 +787,8 @@
that.$element.addClass('in') that.$element.addClass('in')
that.enforceFocus()
transition ? transition ?
that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) : that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
that.$element.trigger('shown') that.$element.trigger('shown')
...@@ -758,90 +811,96 @@ ...@@ -758,90 +811,96 @@
$('body').removeClass('modal-open') $('body').removeClass('modal-open')
escape.call(this) this.escape()
$(document).off('focusin.modal')
this.$element.removeClass('in') this.$element.removeClass('in')
$.support.transition && this.$element.hasClass('fade') ? $.support.transition && this.$element.hasClass('fade') ?
hideWithTransition.call(this) : this.hideWithTransition() :
hideModal.call(this) this.hideModal()
} }
} , enforceFocus: function () {
var that = this
$(document).on('focusin.modal', function (e) {
/* MODAL PRIVATE METHODS if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
* ===================== */ that.$element.focus()
}
})
}
function hideWithTransition() { , escape: function () {
var that = this var that = this
, timeout = setTimeout(function () { if (this.isShown && this.options.keyboard) {
that.$element.off($.support.transition.end) $(document).on('keyup.dismiss.modal', function ( e ) {
hideModal.call(that) e.which == 27 && that.hide()
}, 500) })
} else if (!this.isShown) {
$(document).off('keyup.dismiss.modal')
}
}
this.$element.one($.support.transition.end, function () { , hideWithTransition: function () {
clearTimeout(timeout) var that = this
hideModal.call(that) , timeout = setTimeout(function () {
}) that.$element.off($.support.transition.end)
} that.hideModal()
}, 500)
function hideModal(that) { this.$element.one($.support.transition.end, function () {
this.$element clearTimeout(timeout)
.hide() that.hideModal()
.trigger('hidden') })
}
backdrop.call(this) , hideModal: function (that) {
} this.$element
.hide()
.trigger('hidden')
function backdrop(callback) { this.backdrop()
var that = this }
, animate = this.$element.hasClass('fade') ? 'fade' : ''
if (this.isShown && this.options.backdrop) { , removeBackdrop: function () {
var doAnimate = $.support.transition && animate this.$backdrop.remove()
this.$backdrop = null
}
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />') , backdrop: function (callback) {
.appendTo(document.body) var that = this
, animate = this.$element.hasClass('fade') ? 'fade' : ''
if (this.options.backdrop != 'static') { if (this.isShown && this.options.backdrop) {
this.$backdrop.click($.proxy(this.hide, this)) var doAnimate = $.support.transition && animate
}
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
.appendTo(document.body)
this.$backdrop.addClass('in') if (this.options.backdrop != 'static') {
this.$backdrop.click($.proxy(this.hide, this))
}
doAnimate ? if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
this.$backdrop.one($.support.transition.end, callback) :
callback()
} else if (!this.isShown && this.$backdrop) { this.$backdrop.addClass('in')
this.$backdrop.removeClass('in')
$.support.transition && this.$element.hasClass('fade')? doAnimate ?
this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) : this.$backdrop.one($.support.transition.end, callback) :
removeBackdrop.call(this) callback()
} else if (callback) { } else if (!this.isShown && this.$backdrop) {
callback() this.$backdrop.removeClass('in')
}
}
function removeBackdrop() { $.support.transition && this.$element.hasClass('fade')?
this.$backdrop.remove() this.$backdrop.one($.support.transition.end, $.proxy(this.removeBackdrop, this)) :
this.$backdrop = null this.removeBackdrop()
}
function escape() { } else if (callback) {
var that = this callback()
if (this.isShown && this.options.keyboard) { }
$(document).on('keyup.dismiss.modal', function ( e ) { }
e.which == 27 && that.hide()
})
} else if (!this.isShown) {
$(document).off('keyup.dismiss.modal')
}
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
"laxbreak" : true, "laxbreak" : true,
"browser" : true, "browser" : true,
"debug" : true, "debug" : true,
"devel" : true,
"boss" : true, "boss" : true,
"expr" : true, "expr" : true,
"asi" : true "asi" : true
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
/* DROPDOWN CLASS DEFINITION /* DROPDOWN CLASS DEFINITION
* ========================= */ * ========================= */
var toggle = '[data-toggle="dropdown"]' var toggle = '[data-toggle=dropdown]'
, Dropdown = function (element) { , Dropdown = function (element) {
var $el = $(element).on('click.dropdown.data-api', this.toggle) var $el = $(element).on('click.dropdown.data-api', this.toggle)
$('html').on('click.dropdown.data-api', function () { $('html').on('click.dropdown.data-api', function () {
...@@ -41,34 +41,82 @@ ...@@ -41,34 +41,82 @@
, toggle: function (e) { , toggle: function (e) {
var $this = $(this) var $this = $(this)
, $parent , $parent
, selector
, isActive , isActive
if ($this.is('.disabled, :disabled')) return if ($this.is('.disabled, :disabled')) return
selector = $this.attr('data-target') $parent = getParent($this)
if (!selector) { isActive = $parent.hasClass('open')
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 clearMenus()
if (!isActive) {
$parent.toggleClass('open')
$this.focus()
} }
$parent = $(selector) return false
$parent.length || ($parent = $this.parent()) }
, keydown: function (e) {
var $this
, $items
, $active
, $parent
, isActive
, index
if (!/(38|40|27)/.test(e.keyCode)) return
$this = $(this)
e.preventDefault()
e.stopPropagation()
if ($this.is('.disabled, :disabled')) return
$parent = getParent($this)
isActive = $parent.hasClass('open') isActive = $parent.hasClass('open')
clearMenus() if (!isActive || (isActive && e.keyCode == 27)) return $this.click()
if (!isActive) $parent.toggleClass('open') $items = $('[role=menu] li:not(.divider) a', $parent)
return false if (!$items.length) return
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)
.focus()
} }
} }
function clearMenus() { function clearMenus() {
$(toggle).parent().removeClass('open') getParent($(toggle))
.removeClass('open')
}
function getParent($this) {
var selector = $this.attr('data-target')
, $parent
if (!selector) {
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
}
$parent = $(selector)
$parent.length || ($parent = $this.parent())
return $parent
} }
...@@ -91,10 +139,12 @@ ...@@ -91,10 +139,12 @@
* =================================== */ * =================================== */
$(function () { $(function () {
$('html').on('click.dropdown.data-api', clearMenus) $('html')
.on('click.dropdown.data-api', clearMenus)
$('body') $('body')
.on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() }) .on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
.on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle) .on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
.on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
}) })
}(window.jQuery); }(window.jQuery);
\ No newline at end of file
...@@ -52,8 +52,9 @@ ...@@ -52,8 +52,9 @@
this.isShown = true this.isShown = true
escape.call(this) this.escape()
backdrop.call(this, function () {
this.backdrop(function () {
var transition = $.support.transition && that.$element.hasClass('fade') var transition = $.support.transition && that.$element.hasClass('fade')
if (!that.$element.parent().length) { if (!that.$element.parent().length) {
...@@ -69,6 +70,8 @@ ...@@ -69,6 +70,8 @@
that.$element.addClass('in') that.$element.addClass('in')
that.enforceFocus()
transition ? transition ?
that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) : that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
that.$element.trigger('shown') that.$element.trigger('shown')
...@@ -91,90 +94,96 @@ ...@@ -91,90 +94,96 @@
$('body').removeClass('modal-open') $('body').removeClass('modal-open')
escape.call(this) this.escape()
$(document).off('focusin.modal')
this.$element.removeClass('in') this.$element.removeClass('in')
$.support.transition && this.$element.hasClass('fade') ? $.support.transition && this.$element.hasClass('fade') ?
hideWithTransition.call(this) : this.hideWithTransition() :
hideModal.call(this) this.hideModal()
} }
} , enforceFocus: function () {
var that = this
$(document).on('focusin.modal', function (e) {
/* MODAL PRIVATE METHODS if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
* ===================== */ that.$element.focus()
}
function hideWithTransition() { })
var that = this }
, timeout = setTimeout(function () {
that.$element.off($.support.transition.end)
hideModal.call(that)
}, 500)
this.$element.one($.support.transition.end, function () { , escape: function () {
clearTimeout(timeout) var that = this
hideModal.call(that) if (this.isShown && this.options.keyboard) {
}) $(document).on('keyup.dismiss.modal', function ( e ) {
} e.which == 27 && that.hide()
})
} else if (!this.isShown) {
$(document).off('keyup.dismiss.modal')
}
}
function hideModal(that) { , hideWithTransition: function () {
this.$element var that = this
.hide() , timeout = setTimeout(function () {
.trigger('hidden') that.$element.off($.support.transition.end)
that.hideModal()
}, 500)
this.$element.one($.support.transition.end, function () {
clearTimeout(timeout)
that.hideModal()
})
}
backdrop.call(this) , hideModal: function (that) {
} this.$element
.hide()
.trigger('hidden')
function backdrop(callback) { this.backdrop()
var that = this }
, animate = this.$element.hasClass('fade') ? 'fade' : ''
if (this.isShown && this.options.backdrop) { , removeBackdrop: function () {
var doAnimate = $.support.transition && animate this.$backdrop.remove()
this.$backdrop = null
}
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />') , backdrop: function (callback) {
.appendTo(document.body) var that = this
, animate = this.$element.hasClass('fade') ? 'fade' : ''
if (this.options.backdrop != 'static') { if (this.isShown && this.options.backdrop) {
this.$backdrop.click($.proxy(this.hide, this)) var doAnimate = $.support.transition && animate
}
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
.appendTo(document.body)
this.$backdrop.addClass('in') if (this.options.backdrop != 'static') {
this.$backdrop.click($.proxy(this.hide, this))
}
doAnimate ? if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
this.$backdrop.one($.support.transition.end, callback) :
callback()
} else if (!this.isShown && this.$backdrop) { this.$backdrop.addClass('in')
this.$backdrop.removeClass('in')
$.support.transition && this.$element.hasClass('fade')? doAnimate ?
this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) : this.$backdrop.one($.support.transition.end, callback) :
removeBackdrop.call(this) callback()
} else if (callback) { } else if (!this.isShown && this.$backdrop) {
callback() this.$backdrop.removeClass('in')
}
}
function removeBackdrop() { $.support.transition && this.$element.hasClass('fade')?
this.$backdrop.remove() this.$backdrop.one($.support.transition.end, $.proxy(this.removeBackdrop, this)) :
this.$backdrop = null this.removeBackdrop()
}
function escape() { } else if (callback) {
var that = this callback()
if (this.isShown && this.options.keyboard) { }
$(document).on('keyup.dismiss.modal', function ( e ) { }
e.which == 27 && that.hide()
})
} else if (!this.isShown) {
$(document).off('keyup.dismiss.modal')
}
} }
......
...@@ -34,11 +34,16 @@ ...@@ -34,11 +34,16 @@
margin-top: 8px; margin-top: 8px;
margin-left: 2px; margin-left: 2px;
} }
.dropdown:hover .caret, .dropdown a:focus .caret,
.dropdown a:hover .caret,
.open .caret { .open .caret {
.opacity(100); .opacity(100);
} }
.navbar .nav .open > a {
color: @navbarLinkColorActive;
}
// The dropdown menu (ul) // The dropdown menu (ul)
// ---------------------- // ----------------------
.dropdown-menu { .dropdown-menu {
...@@ -89,11 +94,13 @@ ...@@ -89,11 +94,13 @@
// Hover state // Hover state
// ----------- // -----------
.dropdown-menu li > a:hover, .dropdown-menu li > a:hover,
.dropdown-menu li > a:focus,
.dropdown-menu .active > a, .dropdown-menu .active > a,
.dropdown-menu .active > a:hover { .dropdown-menu .active > a:hover {
color: @dropdownLinkColorHover; color: @dropdownLinkColorHover;
text-decoration: none; text-decoration: none;
background-color: @dropdownLinkBackgroundHover; background-color: @dropdownLinkBackgroundHover;
outline: 0;
} }
// Open state for the dropdown // Open state for the dropdown
......
...@@ -222,6 +222,7 @@ ...@@ -222,6 +222,7 @@
padding: ((@navbarHeight - @elementHeight) / 2 - 1) 5px ((@navbarHeight - @elementHeight) / 2); padding: ((@navbarHeight - @elementHeight) / 2 - 1) 5px ((@navbarHeight - @elementHeight) / 2);
} }
// Hover // Hover
.navbar .nav > li > a:focus,
.navbar .nav > li > a:hover { .navbar .nav > li > a:hover {
background-color: @navbarLinkBackgroundHover; // "transparent" is default to differentiate :hover from .active background-color: @navbarLinkBackgroundHover; // "transparent" is default to differentiate :hover from .active
color: @navbarLinkColorHover; color: @navbarLinkColorHover;
...@@ -230,7 +231,8 @@ ...@@ -230,7 +231,8 @@
// Active nav items // Active nav items
.navbar .nav .active > a, .navbar .nav .active > a,
.navbar .nav .active > a:hover { .navbar .nav .active > a:hover,
.navbar .nav .active > a:focus {
color: @navbarLinkColorActive; color: @navbarLinkColorActive;
text-decoration: none; text-decoration: none;
background-color: @navbarLinkBackgroundActive; background-color: @navbarLinkBackgroundActive;
...@@ -337,6 +339,7 @@ ...@@ -337,6 +339,7 @@
} }
// Dropdown link on hover // Dropdown link on hover
.navbar .nav li.dropdown.active > .dropdown-toggle:focus,
.navbar .nav li.dropdown.active > .dropdown-toggle:hover { .navbar .nav li.dropdown.active > .dropdown-toggle:hover {
color: @white; color: @white;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment