|
100 | 100 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
101 | 101 | }
|
102 | 102 |
|
103 |
| - $parent = $(selector) |
| 103 | + $parent = $(document).find(selector) |
104 | 104 |
|
105 | 105 | e && e.preventDefault()
|
106 | 106 |
|
|
436 | 436 | * ================= */
|
437 | 437 |
|
438 | 438 | $(document).on('click.carousel.data-api', '[data-slide]', function (e) {
|
| 439 | + var selector = $(this).attr('data-target') || (href = $(this).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 |
439 | 440 | var $this = $(this), href
|
440 |
| - , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 |
| 441 | + , $target = $(document).find(selector) |
441 | 442 | , options = $.extend({}, $target.data(), $this.data())
|
442 | 443 | $target.carousel(options)
|
443 | 444 | e.preventDefault()
|
|
600 | 601 | * ================= */
|
601 | 602 |
|
602 | 603 | $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
|
| 604 | + var selector = $(this).attr('data-target') || e.preventDefault() || (href = $(this).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 |
603 | 605 | var $this = $(this), href
|
604 |
| - , target = $this.attr('data-target') |
605 |
| - || e.preventDefault() |
606 |
| - || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 |
| 606 | + , target = $(document).find(selector) |
607 | 607 | , option = $(target).data('collapse') ? 'toggle' : $this.data()
|
608 | 608 | $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
|
609 | 609 | $(target).collapse(option)
|
|
726 | 726 | selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
727 | 727 | }
|
728 | 728 |
|
729 |
| - $parent = $(selector) |
| 729 | + $parent = $(document).find(selector) |
730 | 730 | $parent.length || ($parent = $this.parent())
|
731 | 731 |
|
732 | 732 | return $parent
|
|
999 | 999 | * ============== */
|
1000 | 1000 |
|
1001 | 1001 | $(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
|
1002 |
| - var $this = $(this) |
1003 |
| - , href = $this.attr('href') |
1004 |
| - , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7 |
| 1002 | + var selector = $(this).attr('data-target') || (href = $(this).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 |
| 1003 | + var $this = $(this), href |
| 1004 | + , $target = $(document).find(selector) |
1005 | 1005 | , option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
|
1006 | 1006 |
|
1007 | 1007 | e.preventDefault()
|
|
1221 | 1221 | , $e = this.$element
|
1222 | 1222 | , o = this.options
|
1223 | 1223 |
|
1224 |
| - title = $e.attr('data-original-title') |
| 1224 | + var target = $e.attr('data-original-title') |
| 1225 | + |
| 1226 | + title = $(document).find(target) |
1225 | 1227 | || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
|
1226 | 1228 |
|
1227 | 1229 | return title
|
|
1635 | 1637 |
|
1636 | 1638 | if (e.isDefaultPrevented()) return
|
1637 | 1639 |
|
1638 |
| - $target = $(selector) |
| 1640 | + $target = $(document).find(selector) |
1639 | 1641 |
|
1640 | 1642 | this.activate($this.parent('li'), $ul)
|
1641 | 1643 | this.activate($target, $target.parent(), function () {
|
|
0 commit comments