diff options
| author | Mark Otto <[email protected]> | 2011-09-08 23:02:13 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2011-09-08 23:02:13 -0700 |
| commit | 1a8fb2dbf76b19c899ff8ae73a87c3727c1113cf (patch) | |
| tree | fc67e274699dd774de3aefadf95635bf071d9b74 /docs/assets | |
| parent | ba08055a7be248582ce6b5ba00bf04f5c821bcdd (diff) | |
| parent | 5960711d0f79f7031b444bafba9a856c77f697bc (diff) | |
| download | bootstrap-1a8fb2dbf76b19c899ff8ae73a87c3727c1113cf.tar.xz bootstrap-1a8fb2dbf76b19c899ff8ae73a87c3727c1113cf.zip | |
resolve conflict
Diffstat (limited to 'docs/assets')
| -rw-r--r-- | docs/assets/css/docs.css | 1 | ||||
| -rw-r--r-- | docs/assets/js/application-scrollspy.js | 39 | ||||
| -rw-r--r-- | docs/assets/js/application.js | 75 | ||||
| -rw-r--r-- | docs/assets/js/bootstrap-dropdown.js | 6 | ||||
| -rw-r--r-- | docs/assets/js/bootstrap-scrollspy.js | 0 | ||||
| -rw-r--r-- | docs/assets/js/bootstrap-tabs.js | 38 |
6 files changed, 94 insertions, 65 deletions
diff --git a/docs/assets/css/docs.css b/docs/assets/css/docs.css index dd62bcb9e..b8ac95c42 100644 --- a/docs/assets/css/docs.css +++ b/docs/assets/css/docs.css @@ -222,6 +222,7 @@ div.topbar-wrapper div.topbar .topbar-inner { position: relative; height: 40px; margin: 5px 0 15px; + z-index: 1; } #bootstrap-js div.topbar-wrapper div.topbar { diff --git a/docs/assets/js/application-scrollspy.js b/docs/assets/js/application-scrollspy.js new file mode 100644 index 000000000..1f0b7cebe --- /dev/null +++ b/docs/assets/js/application-scrollspy.js @@ -0,0 +1,39 @@ +// scroll spy logic +// ================ +$(function () { + + var activeTarget, + position = {}, + $window = $(window), + nav = $('body > .topbar li a'), + targets = nav.map(function () { + return $(this).attr('href'); + }), + offsets = $.map(targets, function (id) { + return $(id).offset().top; + }); + + function setButton(id) { + nav.parent("li").removeClass('active'); + $(nav[$.inArray(id, targets)]).parent("li").addClass('active'); + } + + function processScroll(e) { + var scrollTop = $window.scrollTop() + 10, i; + for (i = offsets.length; i--;) { + if (activeTarget != targets[i] && scrollTop >= offsets[i] && (!offsets[i + 1] || scrollTop <= offsets[i + 1])) { + activeTarget = targets[i]; + setButton(activeTarget); + } + } + } + + nav.click(function () { + processScroll(); + }); + + processScroll(); + + $window.scroll(processScroll); + +})
\ No newline at end of file diff --git a/docs/assets/js/application.js b/docs/assets/js/application.js index ec4ae3c06..475329398 100644 --- a/docs/assets/js/application.js +++ b/docs/assets/js/application.js @@ -1,96 +1,46 @@ $(document).ready(function(){ - // Google code prettify - // ==================== - - prettyPrint(); - - - // scroll spy logic - // ================ - - var activeTarget, - position = {}, - $window = $(window), - nav = $('body > .topbar li a'), - targets = nav.map(function () { - return $(this).attr('href'); - }), - offsets = $.map(targets, function (id) { - return $(id).offset().top; - }); - - function setButton(id) { - nav.parent("li").removeClass('active'); - $(nav[$.inArray(id, targets)]).parent("li").addClass('active'); - } - - function processScroll(e) { - var scrollTop = $window.scrollTop() + 10, i; - for (i = offsets.length; i--;) { - if (activeTarget != targets[i] && scrollTop >= offsets[i] && (!offsets[i + 1] || scrollTop <= offsets[i + 1])) { - activeTarget = targets[i]; - setButton(activeTarget); - } - } - } - - nav.click(function () { - processScroll(); - }); - - processScroll(); - - $window.scroll(processScroll); - - // Dropdown example for topbar nav // =============================== - $("body").bind("click", function (e) { - $('.dropdown-toggle, .menu').parent("li").removeClass("open"); - }); - $(".dropdown-toggle, .menu").click(function (e) { - var $li = $(this).parent("li").toggleClass('open'); - return false; - }); + $(".topbar").dropdown() // catch any dropdowns on the page // table sort example // ================== - $("#sortTableExample").tablesorter( {sortList: [[1,0]]} ); + $("#sortTableExample").tablesorter( { sortList: [[ 1, 0 ]] } ) // add on logic // ============ - $('.add-on :checkbox').click(function() { + $('.add-on :checkbox').click(function () { if ($(this).attr('checked')) { - $(this).parents('.add-on').addClass('active'); + $(this).parents('.add-on').addClass('active') } else { - $(this).parents('.add-on').removeClass('active'); + $(this).parents('.add-on').removeClass('active') } - }); + }) // Disable certain links in docs // ============================= - $('ul.tabs a, ul.pills a, .pagination a, .well .btn, .actions .btn, .alert-message .btn, a.close').click(function(e) { - e.preventDefault(); - }); + $('ul.tabs a, ul.pills a, .pagination a, .well .btn, .actions .btn, .alert-message .btn, a.close').click(function (e) { + e.preventDefault() + }) // Copy code blocks in docs - $(".copy-code").focus(function() { + $(".copy-code").focus(function () { var el = this; // push select to event loop for chrome :{o setTimeout(function () { $(el).select(); }, 1); }); - // POSITION TWIPSIES - // ================= + // POSITION STATIC TWIPSIES + // ======================== $('.twipsies.well a').each(function () { var type = this.title @@ -128,7 +78,6 @@ $(document).ready(function(){ } $twipsy.css(offset[type]) - }); }); diff --git a/docs/assets/js/bootstrap-dropdown.js b/docs/assets/js/bootstrap-dropdown.js index 9fbeb44b0..fe73e7994 100644 --- a/docs/assets/js/bootstrap-dropdown.js +++ b/docs/assets/js/bootstrap-dropdown.js @@ -3,8 +3,10 @@ /* DROPDOWN PLUGIN DEFINITION * ========================== */ + var selector = 'a.menu, .dropdown-toggle' + function clearMenus() { - $('a.menu').parent('li').removeClass('open') + $(selector).parent('li').removeClass('open') } $(function () { @@ -13,7 +15,7 @@ $.fn.dropdown = function ( options ) { return this.each(function () { - $(this).delegate('a.menu', 'click', function (e) { + $(this).delegate(selector, 'click', function (e) { clearMenus() $(this).parent('li').toggleClass('open') return false diff --git a/docs/assets/js/bootstrap-scrollspy.js b/docs/assets/js/bootstrap-scrollspy.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/docs/assets/js/bootstrap-scrollspy.js diff --git a/docs/assets/js/bootstrap-tabs.js b/docs/assets/js/bootstrap-tabs.js new file mode 100644 index 000000000..21386f4cf --- /dev/null +++ b/docs/assets/js/bootstrap-tabs.js @@ -0,0 +1,38 @@ +(function( $ ){ + + function activate ( element, container ) { + container.find('.active').removeClass('active') + element.addClass('active') + } + + function tab( e ) { + var $this = $(this) + , href = $this.attr('href') + , $ul = $(e.liveFired) + , $controlled + + if (/^#/.test(href)) { + e.preventDefault() + + if ($this.hasClass('active')) { + return + } + + $controlled = $('#' + $ul.attr('aria-controls')) + + activate($this.parent('li'), $ul) + activate($(href, $controlled), $controlled) + } + } + + + /* TABS/PILLS PLUGIN DEFINITION + * ============================ */ + + $.fn.tabs = $.fn.pills = function () { + return this.each(function () { + $(this).delegate('.tabs > li > a, .pills > li > a', 'click', tab) + }) + } + +})( jQuery || ender )
\ No newline at end of file |
