mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-17 19:21:23 +03:00
Merge branch '2.3.0-wip' into 3.0.0-wip
Conflicts: docs/assets/css/bootstrap-responsive.css docs/assets/js/bootstrap-popover.js docs/assets/js/bootstrap.js docs/css.html docs/templates/pages/base-css.mustache js/bootstrap-popover.js less/mixins.less less/tooltip.less
This commit is contained in:
Vendored
+17
-1
@@ -3835,7 +3835,6 @@ button.close {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 1030;
|
z-index: 1030;
|
||||||
display: block;
|
display: block;
|
||||||
padding: 5px;
|
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
@@ -3849,18 +3848,22 @@ button.close {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tooltip.top {
|
.tooltip.top {
|
||||||
|
padding: 5px 0;
|
||||||
margin-top: -3px;
|
margin-top: -3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tooltip.right {
|
.tooltip.right {
|
||||||
|
padding: 0 5px;
|
||||||
margin-left: 3px;
|
margin-left: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tooltip.bottom {
|
.tooltip.bottom {
|
||||||
|
padding: 5px 0;
|
||||||
margin-top: 3px;
|
margin-top: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tooltip.left {
|
.tooltip.left {
|
||||||
|
padding: 0 5px;
|
||||||
margin-left: -3px;
|
margin-left: -3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4703,3 +4706,16 @@ a.counter:focus {
|
|||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.visible-print {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media print {
|
||||||
|
.visible-print {
|
||||||
|
display: inherit !important;
|
||||||
|
}
|
||||||
|
.hidden-print {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Vendored
+1
@@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
cycle: function (e) {
|
cycle: function (e) {
|
||||||
if (!e) this.paused = false
|
if (!e) this.paused = false
|
||||||
|
if (this.interval) clearInterval(this.interval);
|
||||||
this.options.interval
|
this.options.interval
|
||||||
&& !this.paused
|
&& !this.paused
|
||||||
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
|
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
|
||||||
|
|||||||
Vendored
+1
-1
@@ -72,7 +72,7 @@
|
|||||||
|
|
||||||
, hide: function () {
|
, hide: function () {
|
||||||
var dimension
|
var dimension
|
||||||
if (this.transitioning) return
|
if (this.transitioning || !this.$element.hasClass('in')) return
|
||||||
dimension = this.dimension()
|
dimension = this.dimension()
|
||||||
this.reset(this.$element[dimension]())
|
this.reset(this.$element[dimension]())
|
||||||
this.transition('removeClass', $.Event('hide'), 'hidden')
|
this.transition('removeClass', $.Event('hide'), 'hidden')
|
||||||
|
|||||||
Vendored
+5
-5
@@ -156,10 +156,10 @@
|
|||||||
* =================================== */
|
* =================================== */
|
||||||
|
|
||||||
$(document)
|
$(document)
|
||||||
.on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
|
.on('click.dropdown.data-api', clearMenus)
|
||||||
.on('click.dropdown.data-api touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
.on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
||||||
.on('touchstart.dropdown.data-api', '.dropdown-menu', function (e) { e.stopPropagation() })
|
.on('.dropdown-menu', function (e) { e.stopPropagation() })
|
||||||
.on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
|
.on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
|
||||||
.on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
|
.on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
|
||||||
|
|
||||||
}(window.jQuery);
|
}(window.jQuery);
|
||||||
Vendored
+2
-2
@@ -58,8 +58,8 @@
|
|||||||
, $e = this.$element
|
, $e = this.$element
|
||||||
, o = this.options
|
, o = this.options
|
||||||
|
|
||||||
content = $e.attr('data-content')
|
content = (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
|
||||||
|| (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
|
|| $e.attr('data-content')
|
||||||
|
|
||||||
return content
|
return content
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+54
-7
@@ -67,7 +67,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
, getOptions: function (options) {
|
, getOptions: function (options) {
|
||||||
options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
|
options = $.extend({}, $.fn[this.type].defaults, this.$element.data(), options)
|
||||||
|
|
||||||
if (options.delay && typeof options.delay == 'number') {
|
if (options.delay && typeof options.delay == 'number') {
|
||||||
options.delay = {
|
options.delay = {
|
||||||
@@ -152,15 +152,58 @@
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
$tip
|
this.applyPlacement(tp, placement)
|
||||||
.offset(tp)
|
|
||||||
.addClass(placement)
|
|
||||||
.addClass('in')
|
|
||||||
|
|
||||||
this.$element.trigger('shown')
|
this.$element.trigger('shown')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
, applyPlacement: function(offset, placement){
|
||||||
|
var $tip = this.tip()
|
||||||
|
, width = $tip[0].offsetWidth
|
||||||
|
, height = $tip[0].offsetHeight
|
||||||
|
, actualWidth
|
||||||
|
, actualHeight
|
||||||
|
, delta
|
||||||
|
, replace
|
||||||
|
|
||||||
|
$tip
|
||||||
|
.offset(offset)
|
||||||
|
.addClass(placement)
|
||||||
|
.addClass('in')
|
||||||
|
|
||||||
|
actualWidth = $tip[0].offsetWidth
|
||||||
|
actualHeight = $tip[0].offsetHeight
|
||||||
|
|
||||||
|
if (placement == 'top' && actualHeight != height) {
|
||||||
|
offset.top = offset.top + height - actualHeight
|
||||||
|
replace = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if (placement == 'bottom' || placement == 'top') {
|
||||||
|
delta = 0
|
||||||
|
|
||||||
|
if (offset.left < 0){
|
||||||
|
delta = offset.left * -2
|
||||||
|
offset.left = 0
|
||||||
|
$tip.offset(offset)
|
||||||
|
actualWidth = $tip[0].offsetWidth
|
||||||
|
actualHeight = $tip[0].offsetHeight
|
||||||
|
}
|
||||||
|
|
||||||
|
this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
|
||||||
|
} else {
|
||||||
|
this.replaceArrow(actualHeight - height, actualHeight, 'top')
|
||||||
|
}
|
||||||
|
|
||||||
|
if (replace) $tip.offset(offset)
|
||||||
|
}
|
||||||
|
|
||||||
|
, replaceArrow: function(delta, dimension, position){
|
||||||
|
this
|
||||||
|
.arrow()
|
||||||
|
.css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
|
||||||
|
}
|
||||||
|
|
||||||
, setContent: function () {
|
, setContent: function () {
|
||||||
var $tip = this.tip()
|
var $tip = this.tip()
|
||||||
, title = this.getTitle()
|
, title = this.getTitle()
|
||||||
@@ -212,7 +255,7 @@
|
|||||||
|
|
||||||
, getPosition: function () {
|
, getPosition: function () {
|
||||||
var el = this.$element[0]
|
var el = this.$element[0]
|
||||||
return $.extend({}, el.getBoundingClientRect ? el.getBoundingClientRect() : {
|
return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
|
||||||
width: el.offsetWidth
|
width: el.offsetWidth
|
||||||
, height: el.offsetHeight
|
, height: el.offsetHeight
|
||||||
}, this.$element.offset())
|
}, this.$element.offset())
|
||||||
@@ -233,6 +276,10 @@
|
|||||||
return this.$tip = this.$tip || $(this.options.template)
|
return this.$tip = this.$tip || $(this.options.template)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
, arrow: function(){
|
||||||
|
return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
|
||||||
|
}
|
||||||
|
|
||||||
, validate: function () {
|
, validate: function () {
|
||||||
if (!this.$element[0].parentNode) {
|
if (!this.$element[0].parentNode) {
|
||||||
this.hide()
|
this.hide()
|
||||||
|
|||||||
Vendored
+65
-16
@@ -300,6 +300,7 @@
|
|||||||
|
|
||||||
cycle: function (e) {
|
cycle: function (e) {
|
||||||
if (!e) this.paused = false
|
if (!e) this.paused = false
|
||||||
|
if (this.interval) clearInterval(this.interval);
|
||||||
this.options.interval
|
this.options.interval
|
||||||
&& !this.paused
|
&& !this.paused
|
||||||
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
|
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
|
||||||
@@ -538,7 +539,7 @@
|
|||||||
|
|
||||||
, hide: function () {
|
, hide: function () {
|
||||||
var dimension
|
var dimension
|
||||||
if (this.transitioning) return
|
if (this.transitioning || !this.$element.hasClass('in')) return
|
||||||
dimension = this.dimension()
|
dimension = this.dimension()
|
||||||
this.reset(this.$element[dimension]())
|
this.reset(this.$element[dimension]())
|
||||||
this.transition('removeClass', $.Event('hide'), 'hidden')
|
this.transition('removeClass', $.Event('hide'), 'hidden')
|
||||||
@@ -788,13 +789,14 @@
|
|||||||
* =================================== */
|
* =================================== */
|
||||||
|
|
||||||
$(document)
|
$(document)
|
||||||
.on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
|
.on('click.dropdown.data-api', clearMenus)
|
||||||
.on('click.dropdown.data-api touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
.on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
||||||
.on('touchstart.dropdown.data-api', '.dropdown-menu', function (e) { e.stopPropagation() })
|
.on('.dropdown-menu', function (e) { e.stopPropagation() })
|
||||||
.on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
|
.on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
|
||||||
.on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
|
.on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
|
||||||
|
|
||||||
}(window.jQuery);/* =========================================================
|
}(window.jQuery);
|
||||||
|
/* =========================================================
|
||||||
* bootstrap-modal.js v3.0.0
|
* bootstrap-modal.js v3.0.0
|
||||||
* http://twitter.github.com/bootstrap/javascript.html#modals
|
* http://twitter.github.com/bootstrap/javascript.html#modals
|
||||||
* =========================================================
|
* =========================================================
|
||||||
@@ -1107,7 +1109,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
, getOptions: function (options) {
|
, getOptions: function (options) {
|
||||||
options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
|
options = $.extend({}, $.fn[this.type].defaults, this.$element.data(), options)
|
||||||
|
|
||||||
if (options.delay && typeof options.delay == 'number') {
|
if (options.delay && typeof options.delay == 'number') {
|
||||||
options.delay = {
|
options.delay = {
|
||||||
@@ -1192,15 +1194,58 @@
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
$tip
|
this.applyPlacement(tp, placement)
|
||||||
.offset(tp)
|
|
||||||
.addClass(placement)
|
|
||||||
.addClass('in')
|
|
||||||
|
|
||||||
this.$element.trigger('shown')
|
this.$element.trigger('shown')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
, applyPlacement: function(offset, placement){
|
||||||
|
var $tip = this.tip()
|
||||||
|
, width = $tip[0].offsetWidth
|
||||||
|
, height = $tip[0].offsetHeight
|
||||||
|
, actualWidth
|
||||||
|
, actualHeight
|
||||||
|
, delta
|
||||||
|
, replace
|
||||||
|
|
||||||
|
$tip
|
||||||
|
.offset(offset)
|
||||||
|
.addClass(placement)
|
||||||
|
.addClass('in')
|
||||||
|
|
||||||
|
actualWidth = $tip[0].offsetWidth
|
||||||
|
actualHeight = $tip[0].offsetHeight
|
||||||
|
|
||||||
|
if (placement == 'top' && actualHeight != height) {
|
||||||
|
offset.top = offset.top + height - actualHeight
|
||||||
|
replace = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if (placement == 'bottom' || placement == 'top') {
|
||||||
|
delta = 0
|
||||||
|
|
||||||
|
if (offset.left < 0){
|
||||||
|
delta = offset.left * -2
|
||||||
|
offset.left = 0
|
||||||
|
$tip.offset(offset)
|
||||||
|
actualWidth = $tip[0].offsetWidth
|
||||||
|
actualHeight = $tip[0].offsetHeight
|
||||||
|
}
|
||||||
|
|
||||||
|
this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
|
||||||
|
} else {
|
||||||
|
this.replaceArrow(actualHeight - height, actualHeight, 'top')
|
||||||
|
}
|
||||||
|
|
||||||
|
if (replace) $tip.offset(offset)
|
||||||
|
}
|
||||||
|
|
||||||
|
, replaceArrow: function(delta, dimension, position){
|
||||||
|
this
|
||||||
|
.arrow()
|
||||||
|
.css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
|
||||||
|
}
|
||||||
|
|
||||||
, setContent: function () {
|
, setContent: function () {
|
||||||
var $tip = this.tip()
|
var $tip = this.tip()
|
||||||
, title = this.getTitle()
|
, title = this.getTitle()
|
||||||
@@ -1252,7 +1297,7 @@
|
|||||||
|
|
||||||
, getPosition: function () {
|
, getPosition: function () {
|
||||||
var el = this.$element[0]
|
var el = this.$element[0]
|
||||||
return $.extend({}, el.getBoundingClientRect ? el.getBoundingClientRect() : {
|
return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
|
||||||
width: el.offsetWidth
|
width: el.offsetWidth
|
||||||
, height: el.offsetHeight
|
, height: el.offsetHeight
|
||||||
}, this.$element.offset())
|
}, this.$element.offset())
|
||||||
@@ -1273,6 +1318,10 @@
|
|||||||
return this.$tip = this.$tip || $(this.options.template)
|
return this.$tip = this.$tip || $(this.options.template)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
, arrow: function(){
|
||||||
|
return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
|
||||||
|
}
|
||||||
|
|
||||||
, validate: function () {
|
, validate: function () {
|
||||||
if (!this.$element[0].parentNode) {
|
if (!this.$element[0].parentNode) {
|
||||||
this.hide()
|
this.hide()
|
||||||
@@ -1404,8 +1453,8 @@
|
|||||||
, $e = this.$element
|
, $e = this.$element
|
||||||
, o = this.options
|
, o = this.options
|
||||||
|
|
||||||
content = $e.attr('data-content')
|
content = (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
|
||||||
|| (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
|
|| $e.attr('data-content')
|
||||||
|
|
||||||
return content
|
return content
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+5
-2
File diff suppressed because one or more lines are too long
Vendored
+1
@@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
cycle: function (e) {
|
cycle: function (e) {
|
||||||
if (!e) this.paused = false
|
if (!e) this.paused = false
|
||||||
|
if (this.interval) clearInterval(this.interval);
|
||||||
this.options.interval
|
this.options.interval
|
||||||
&& !this.paused
|
&& !this.paused
|
||||||
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
|
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
|
||||||
|
|||||||
Vendored
+1
-1
@@ -72,7 +72,7 @@
|
|||||||
|
|
||||||
, hide: function () {
|
, hide: function () {
|
||||||
var dimension
|
var dimension
|
||||||
if (this.transitioning) return
|
if (this.transitioning || !this.$element.hasClass('in')) return
|
||||||
dimension = this.dimension()
|
dimension = this.dimension()
|
||||||
this.reset(this.$element[dimension]())
|
this.reset(this.$element[dimension]())
|
||||||
this.transition('removeClass', $.Event('hide'), 'hidden')
|
this.transition('removeClass', $.Event('hide'), 'hidden')
|
||||||
|
|||||||
Vendored
+5
-5
@@ -156,10 +156,10 @@
|
|||||||
* =================================== */
|
* =================================== */
|
||||||
|
|
||||||
$(document)
|
$(document)
|
||||||
.on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
|
.on('click.dropdown.data-api', clearMenus)
|
||||||
.on('click.dropdown.data-api touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
.on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
||||||
.on('touchstart.dropdown.data-api', '.dropdown-menu', function (e) { e.stopPropagation() })
|
.on('.dropdown-menu', function (e) { e.stopPropagation() })
|
||||||
.on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
|
.on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
|
||||||
.on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
|
.on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
|
||||||
|
|
||||||
}(window.jQuery);
|
}(window.jQuery);
|
||||||
Vendored
+2
-2
@@ -58,8 +58,8 @@
|
|||||||
, $e = this.$element
|
, $e = this.$element
|
||||||
, o = this.options
|
, o = this.options
|
||||||
|
|
||||||
content = $e.attr('data-content')
|
content = (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
|
||||||
|| (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
|
|| $e.attr('data-content')
|
||||||
|
|
||||||
return content
|
return content
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+54
-7
@@ -67,7 +67,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
, getOptions: function (options) {
|
, getOptions: function (options) {
|
||||||
options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
|
options = $.extend({}, $.fn[this.type].defaults, this.$element.data(), options)
|
||||||
|
|
||||||
if (options.delay && typeof options.delay == 'number') {
|
if (options.delay && typeof options.delay == 'number') {
|
||||||
options.delay = {
|
options.delay = {
|
||||||
@@ -152,15 +152,58 @@
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
$tip
|
this.applyPlacement(tp, placement)
|
||||||
.offset(tp)
|
|
||||||
.addClass(placement)
|
|
||||||
.addClass('in')
|
|
||||||
|
|
||||||
this.$element.trigger('shown')
|
this.$element.trigger('shown')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
, applyPlacement: function(offset, placement){
|
||||||
|
var $tip = this.tip()
|
||||||
|
, width = $tip[0].offsetWidth
|
||||||
|
, height = $tip[0].offsetHeight
|
||||||
|
, actualWidth
|
||||||
|
, actualHeight
|
||||||
|
, delta
|
||||||
|
, replace
|
||||||
|
|
||||||
|
$tip
|
||||||
|
.offset(offset)
|
||||||
|
.addClass(placement)
|
||||||
|
.addClass('in')
|
||||||
|
|
||||||
|
actualWidth = $tip[0].offsetWidth
|
||||||
|
actualHeight = $tip[0].offsetHeight
|
||||||
|
|
||||||
|
if (placement == 'top' && actualHeight != height) {
|
||||||
|
offset.top = offset.top + height - actualHeight
|
||||||
|
replace = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if (placement == 'bottom' || placement == 'top') {
|
||||||
|
delta = 0
|
||||||
|
|
||||||
|
if (offset.left < 0){
|
||||||
|
delta = offset.left * -2
|
||||||
|
offset.left = 0
|
||||||
|
$tip.offset(offset)
|
||||||
|
actualWidth = $tip[0].offsetWidth
|
||||||
|
actualHeight = $tip[0].offsetHeight
|
||||||
|
}
|
||||||
|
|
||||||
|
this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
|
||||||
|
} else {
|
||||||
|
this.replaceArrow(actualHeight - height, actualHeight, 'top')
|
||||||
|
}
|
||||||
|
|
||||||
|
if (replace) $tip.offset(offset)
|
||||||
|
}
|
||||||
|
|
||||||
|
, replaceArrow: function(delta, dimension, position){
|
||||||
|
this
|
||||||
|
.arrow()
|
||||||
|
.css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
|
||||||
|
}
|
||||||
|
|
||||||
, setContent: function () {
|
, setContent: function () {
|
||||||
var $tip = this.tip()
|
var $tip = this.tip()
|
||||||
, title = this.getTitle()
|
, title = this.getTitle()
|
||||||
@@ -212,7 +255,7 @@
|
|||||||
|
|
||||||
, getPosition: function () {
|
, getPosition: function () {
|
||||||
var el = this.$element[0]
|
var el = this.$element[0]
|
||||||
return $.extend({}, el.getBoundingClientRect ? el.getBoundingClientRect() : {
|
return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
|
||||||
width: el.offsetWidth
|
width: el.offsetWidth
|
||||||
, height: el.offsetHeight
|
, height: el.offsetHeight
|
||||||
}, this.$element.offset())
|
}, this.$element.offset())
|
||||||
@@ -233,6 +276,10 @@
|
|||||||
return this.$tip = this.$tip || $(this.options.template)
|
return this.$tip = this.$tip || $(this.options.template)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
, arrow: function(){
|
||||||
|
return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
|
||||||
|
}
|
||||||
|
|
||||||
, validate: function () {
|
, validate: function () {
|
||||||
if (!this.$element[0].parentNode) {
|
if (!this.$element[0].parentNode) {
|
||||||
this.hide()
|
this.hide()
|
||||||
|
|||||||
Vendored
+40
@@ -251,4 +251,44 @@ $(function () {
|
|||||||
ok(!$("#qunit-fixture > .tooltip").length, 'not found in parent')
|
ok(!$("#qunit-fixture > .tooltip").length, 'not found in parent')
|
||||||
tooltip.tooltip('hide')
|
tooltip.tooltip('hide')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test("should place tooltip inside window", function(){
|
||||||
|
var container = $("<div />").appendTo("body")
|
||||||
|
.css({position: "absolute", width: 200, height: 200, bottom: 0, left: 0})
|
||||||
|
, tooltip = $("<a href='#' title='Very very very very very very very very long tooltip'>Hover me</a>")
|
||||||
|
.css({position: "absolute", top:0, left: 0})
|
||||||
|
.appendTo(container)
|
||||||
|
.tooltip({placement: "top", animate: false})
|
||||||
|
.tooltip("show")
|
||||||
|
|
||||||
|
stop()
|
||||||
|
|
||||||
|
setTimeout(function(){
|
||||||
|
ok($(".tooltip").offset().left >= 0)
|
||||||
|
|
||||||
|
start()
|
||||||
|
container.remove()
|
||||||
|
}, 100)
|
||||||
|
})
|
||||||
|
|
||||||
|
test("should place tooltip on top of element", function(){
|
||||||
|
var container = $("<div />").appendTo("body")
|
||||||
|
.css({position: "absolute", bottom: 0, left: 0, textAlign: "right", width: 300, height: 300})
|
||||||
|
, p = $("<p style='margin-top:200px' />").appendTo(container)
|
||||||
|
, tooltiped = $("<a href='#' title='very very very very very very very long tooltip'>Hover me</a>")
|
||||||
|
.css({marginTop: 200})
|
||||||
|
.appendTo(p)
|
||||||
|
.tooltip({placement: "top", animate: false})
|
||||||
|
.tooltip("show")
|
||||||
|
|
||||||
|
stop()
|
||||||
|
|
||||||
|
setTimeout(function(){
|
||||||
|
var tooltip = container.find(".tooltip")
|
||||||
|
|
||||||
|
start()
|
||||||
|
ok(tooltip.offset().top + tooltip.outerHeight() <= tooltiped.offset().top)
|
||||||
|
container.remove()
|
||||||
|
}, 100)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Vendored
+5
-2
File diff suppressed because one or more lines are too long
+5
-6
@@ -472,17 +472,17 @@
|
|||||||
|
|
||||||
.core(@grid-column-width, @grid-gutter-width) {
|
.core(@grid-column-width, @grid-gutter-width) {
|
||||||
|
|
||||||
.spanX(@index) when (@index > 0) {
|
.spanX (@index) when (@index > 0) {
|
||||||
(~".span@{index}") { .span(@index); }
|
.span@{index} { .span(@index); }
|
||||||
.spanX(@index - 1);
|
.spanX(@index - 1);
|
||||||
}
|
}
|
||||||
.spanX(0) {}
|
.spanX(0) {}
|
||||||
|
|
||||||
.offsetX(@index) when (@index > 0) {
|
.offsetX (@index) when (@index > 0) {
|
||||||
(~".offset@{index}") { .offset(@index); }
|
.offset@{index} { .offset(@index); }
|
||||||
.offsetX(@index - 1);
|
.offsetX(@index - 1);
|
||||||
}
|
}
|
||||||
.offsetX(0) {}
|
.offsetX (0) {}
|
||||||
|
|
||||||
// Base styles
|
// Base styles
|
||||||
.offset(@columns) {
|
.offset(@columns) {
|
||||||
@@ -497,5 +497,4 @@
|
|||||||
.offsetX(@grid-columns);
|
.offsetX(@grid-columns);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,3 +48,12 @@
|
|||||||
// Hide
|
// Hide
|
||||||
.hidden-phone { display: none !important; }
|
.hidden-phone { display: none !important; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Print utilities
|
||||||
|
.visible-print { display: none !important; }
|
||||||
|
.hidden-print { }
|
||||||
|
|
||||||
|
@media print {
|
||||||
|
.visible-print { display: inherit !important; }
|
||||||
|
.hidden-print { display: none !important; }
|
||||||
|
}
|
||||||
|
|||||||
+5
-5
@@ -9,15 +9,15 @@
|
|||||||
z-index: @zindex-tooltip;
|
z-index: @zindex-tooltip;
|
||||||
display: block;
|
display: block;
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
padding: 5px;
|
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
.opacity(0);
|
.opacity(0);
|
||||||
|
|
||||||
&.in { .opacity(100); }
|
&.in { .opacity(100); }
|
||||||
&.top { margin-top: -3px; }
|
&.top { margin-top: -3px; padding: 5px 0; }
|
||||||
&.right { margin-left: 3px; }
|
&.right { margin-left: 3px; padding: 0 5px; }
|
||||||
&.bottom { margin-top: 3px; }
|
&.bottom { margin-top: 3px; padding: 5px 0; }
|
||||||
&.left { margin-left: -3px; }
|
&.left { margin-left: -3px; padding: 0 5px; }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wrapper for the tooltip content
|
// Wrapper for the tooltip content
|
||||||
|
|||||||
Reference in New Issue
Block a user