From 5bd8cdca91615dfb502131c276bfc6d8457c5f79 Mon Sep 17 00:00:00 2001 From: fat Date: Wed, 19 Dec 2012 21:36:50 -0800 Subject: =?UTF-8?q?remove=20inside=20support=20from=20tooltip=C2=A0+=20fix?= =?UTF-8?q?=20tooltip=20svg=20support=20+=20change=20makefile=20to=20rely?= =?UTF-8?q?=20on=20local=20npm=20install?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/assets/js/bootstrap.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'docs/assets/js/bootstrap.js') diff --git a/docs/assets/js/bootstrap.js b/docs/assets/js/bootstrap.js index b9d050070..372eaa97b 100644 --- a/docs/assets/js/bootstrap.js +++ b/docs/assets/js/bootstrap.js @@ -1113,7 +1113,6 @@ , show: function () { var $tip - , inside , pos , actualWidth , actualHeight @@ -1132,19 +1131,17 @@ this.options.placement.call(this, $tip[0], this.$element[0]) : this.options.placement - inside = /in/.test(placement) - $tip .detach() .css({ top: 0, left: 0, display: 'block' }) .insertAfter(this.$element) - pos = this.getPosition(inside) + pos = this.getPosition() actualWidth = $tip[0].offsetWidth actualHeight = $tip[0].offsetHeight - switch (inside ? placement.split(' ')[1] : placement) { + switch (placement) { case 'bottom': tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2} break @@ -1209,11 +1206,12 @@ return this.getTitle() } - , getPosition: function (inside) { - return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), { - width: this.$element[0].offsetWidth - , height: this.$element[0].offsetHeight - }) + , getPosition: function () { + var el = this.$element[0] + return $.extend(el.getBoundingClientRect ? el.getBoundingClientRect() : { + width: el.offsetWidth + , height: el.offsetHeight + }, this.$element.offset()) } , getTitle: function () { -- cgit v1.2.3 From dc4e80a655509dc1f68d45c950174e79da2f7f08 Mon Sep 17 00:00:00 2001 From: fat Date: Wed, 19 Dec 2012 21:55:23 -0800 Subject: fix ghetto ass timeout shit --- docs/assets/js/bootstrap.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'docs/assets/js/bootstrap.js') diff --git a/docs/assets/js/bootstrap.js b/docs/assets/js/bootstrap.js index 372eaa97b..1c104a49d 100644 --- a/docs/assets/js/bootstrap.js +++ b/docs/assets/js/bootstrap.js @@ -1889,6 +1889,7 @@ , listen: function () { this.$element + .on('focus', $.proxy(this.focus, this)) .on('blur', $.proxy(this.blur, this)) .on('keypress', $.proxy(this.keypress, this)) .on('keyup', $.proxy(this.keyup, this)) @@ -1900,6 +1901,7 @@ this.$menu .on('click', $.proxy(this.click, this)) .on('mouseenter', 'li', $.proxy(this.mouseenter, this)) + .on('mouseleave', 'li', $.proxy(this.mouseleave, this)) } , eventSupported: function(eventName) { @@ -1973,9 +1975,13 @@ e.preventDefault() } + , focus: function (e) { + this.focused = true + } + , blur: function (e) { - var that = this - setTimeout(function () { that.hide() }, 150) + this.focused = false + if (!this.mousedover && this.shown) this.hide() } , click: function (e) { @@ -1985,10 +1991,16 @@ } , mouseenter: function (e) { + this.mousedover = true this.$menu.find('.active').removeClass('active') $(e.currentTarget).addClass('active') } + , mouseleave: function (e) { + this.mousedover = false + if (!this.focused && this.shown) this.hide() + } + } -- cgit v1.2.3 From 219d275ae67e58f3a4c1d0a2b2daeff427adbaf6 Mon Sep 17 00:00:00 2001 From: fat Date: Wed, 19 Dec 2012 22:03:57 -0800 Subject: can't extend bounding box thingy --- docs/assets/js/bootstrap.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/assets/js/bootstrap.js') diff --git a/docs/assets/js/bootstrap.js b/docs/assets/js/bootstrap.js index 1c104a49d..714d326bc 100644 --- a/docs/assets/js/bootstrap.js +++ b/docs/assets/js/bootstrap.js @@ -1208,7 +1208,8 @@ , getPosition: function () { var el = this.$element[0] - return $.extend(el.getBoundingClientRect ? el.getBoundingClientRect() : { + + return $.extend({}, el.getBoundingClientRect ? el.getBoundingClientRect() : { width: el.offsetWidth , height: el.offsetHeight }, this.$element.offset()) -- cgit v1.2.3 From 96e5fa6143072db64f34482873c6f7d6b3ec4ffd Mon Sep 17 00:00:00 2001 From: fat Date: Wed, 19 Dec 2012 22:26:36 -0800 Subject: whitespace in tooltip + don't pass empty selector to $() in dropdown.js --- docs/assets/js/bootstrap.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/assets/js/bootstrap.js') diff --git a/docs/assets/js/bootstrap.js b/docs/assets/js/bootstrap.js index 714d326bc..612664dd9 100644 --- a/docs/assets/js/bootstrap.js +++ b/docs/assets/js/bootstrap.js @@ -726,8 +726,9 @@ selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 } - $parent = $(selector) - $parent.length || ($parent = $this.parent()) + $parent = selector && $(selector) + + if (!$parent || !$parent.length) $parent = $this.parent() return $parent } @@ -1208,7 +1209,6 @@ , getPosition: function () { var el = this.$element[0] - return $.extend({}, el.getBoundingClientRect ? el.getBoundingClientRect() : { width: el.offsetWidth , height: el.offsetHeight -- cgit v1.2.3 From 7f9ff0ba5b679914defd8bdd45bcf930ee201286 Mon Sep 17 00:00:00 2001 From: fat Date: Wed, 19 Dec 2012 23:25:25 -0800 Subject: add js support for carousel indicators --- docs/assets/js/bootstrap.js | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'docs/assets/js/bootstrap.js') diff --git a/docs/assets/js/bootstrap.js b/docs/assets/js/bootstrap.js index 612664dd9..f9f8487c3 100644 --- a/docs/assets/js/bootstrap.js +++ b/docs/assets/js/bootstrap.js @@ -289,6 +289,7 @@ var Carousel = function (element, options) { this.$element = $(element) + this.$indicators = this.$element.find('.carousel-indicators') this.options = options this.options.pause == 'hover' && this.$element .on('mouseenter', $.proxy(this.pause, this)) @@ -305,13 +306,17 @@ return this } + , getActiveIndex: function () { + this.$active = this.$element.find('.item.active') + this.$items = this.$active.parent().children() + return this.$items.index(this.$active) + } + , to: function (pos) { - var $active = this.$element.find('.item.active') - , children = $active.parent().children() - , activePos = children.index($active) + var activeIndex = this.getActiveIndex() , that = this - if (pos > (children.length - 1) || pos < 0) return + if (pos > (this.$items.length - 1) || pos < 0) return if (this.sliding) { return this.$element.one('slid', function () { @@ -319,11 +324,11 @@ }) } - if (activePos == pos) { + if (activeIndex == pos) { return this.pause().cycle() } - return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos])) + return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) } , pause: function (e) { @@ -353,6 +358,7 @@ , isCycling = this.interval , direction = type == 'next' ? 'left' : 'right' , fallback = type == 'next' ? 'first' : 'last' + , $nextIndicator , that = this , e @@ -368,6 +374,14 @@ if ($next.hasClass('active')) return + if (this.$indicators.length) { + this.$indicators.find('.active').removeClass('active') + this.$element.one('slid', function () { + $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) + $nextIndicator && $nextIndicator.addClass('active') + }) + } + if ($.support.transition && this.$element.hasClass('slide')) { this.$element.trigger(e) if (e.isDefaultPrevented()) return @@ -832,8 +846,7 @@ that.$element.appendTo(document.body) //don't move modals dom position } - that.$element - .show() + that.$element.show() if (transition) { that.$element[0].offsetWidth // force reflow -- cgit v1.2.3 From bbe4625672c5122bb2b06c495f9ea41752c10467 Mon Sep 17 00:00:00 2001 From: fat Date: Wed, 19 Dec 2012 23:39:26 -0800 Subject: lol we dont' have affix(refresh) --- docs/assets/js/bootstrap.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'docs/assets/js/bootstrap.js') diff --git a/docs/assets/js/bootstrap.js b/docs/assets/js/bootstrap.js index f9f8487c3..2e06798f2 100644 --- a/docs/assets/js/bootstrap.js +++ b/docs/assets/js/bootstrap.js @@ -358,7 +358,6 @@ , isCycling = this.interval , direction = type == 'next' ? 'left' : 'right' , fallback = type == 'next' ? 'first' : 'last' - , $nextIndicator , that = this , e @@ -377,7 +376,7 @@ if (this.$indicators.length) { this.$indicators.find('.active').removeClass('active') this.$element.one('slid', function () { - $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) + var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) $nextIndicator && $nextIndicator.addClass('active') }) } -- cgit v1.2.3