mirror of https://github.com/twbs/bootstrap.git
				
				
				
			Merge branch '2.1.0-wip' of github.com:twitter/bootstrap into 2.1.0-wip
This commit is contained in:
		
						commit
						4a84145c43
					
				| 
						 | 
				
			
			@ -69,7 +69,10 @@
 | 
			
		|||
            that.$element[0].offsetWidth // force reflow
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
          that.$element.addClass('in')
 | 
			
		||||
          that.$element
 | 
			
		||||
            .addClass('in')
 | 
			
		||||
            .attr('aria-hidden', false)
 | 
			
		||||
            .focus()
 | 
			
		||||
 | 
			
		||||
          that.enforceFocus()
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -99,7 +102,9 @@
 | 
			
		|||
 | 
			
		||||
        $(document).off('focusin.modal')
 | 
			
		||||
 | 
			
		||||
        this.$element.removeClass('in')
 | 
			
		||||
        this.$element
 | 
			
		||||
          .removeClass('in')
 | 
			
		||||
          .attr('aria-hidden', true)
 | 
			
		||||
 | 
			
		||||
        $.support.transition && this.$element.hasClass('fade') ?
 | 
			
		||||
          this.hideWithTransition() :
 | 
			
		||||
| 
						 | 
				
			
			@ -118,11 +123,11 @@
 | 
			
		|||
    , escape: function () {
 | 
			
		||||
        var that = this
 | 
			
		||||
        if (this.isShown && this.options.keyboard) {
 | 
			
		||||
          $(document).on('keyup.dismiss.modal', function ( e ) {
 | 
			
		||||
          this.$element.on('keyup.dismiss.modal', function ( e ) {
 | 
			
		||||
            e.which == 27 && that.hide()
 | 
			
		||||
          })
 | 
			
		||||
        } else if (!this.isShown) {
 | 
			
		||||
          $(document).off('keyup.dismiss.modal')
 | 
			
		||||
          this.$element.off('keyup.dismiss.modal')
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -222,7 +227,12 @@
 | 
			
		|||
        , option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
 | 
			
		||||
 | 
			
		||||
      e.preventDefault()
 | 
			
		||||
      $target.modal(option)
 | 
			
		||||
 | 
			
		||||
      $target
 | 
			
		||||
        .modal(option)        
 | 
			
		||||
        .one('hide', function () {
 | 
			
		||||
          $this.focus()
 | 
			
		||||
        })
 | 
			
		||||
    })
 | 
			
		||||
  })
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -793,7 +793,10 @@
 | 
			
		|||
            that.$element[0].offsetWidth // force reflow
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
          that.$element.addClass('in')
 | 
			
		||||
          that.$element
 | 
			
		||||
            .addClass('in')
 | 
			
		||||
            .attr('aria-hidden', false)
 | 
			
		||||
            .focus()
 | 
			
		||||
 | 
			
		||||
          that.enforceFocus()
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -823,7 +826,9 @@
 | 
			
		|||
 | 
			
		||||
        $(document).off('focusin.modal')
 | 
			
		||||
 | 
			
		||||
        this.$element.removeClass('in')
 | 
			
		||||
        this.$element
 | 
			
		||||
          .removeClass('in')
 | 
			
		||||
          .attr('aria-hidden', true)
 | 
			
		||||
 | 
			
		||||
        $.support.transition && this.$element.hasClass('fade') ?
 | 
			
		||||
          this.hideWithTransition() :
 | 
			
		||||
| 
						 | 
				
			
			@ -842,11 +847,11 @@
 | 
			
		|||
    , escape: function () {
 | 
			
		||||
        var that = this
 | 
			
		||||
        if (this.isShown && this.options.keyboard) {
 | 
			
		||||
          $(document).on('keyup.dismiss.modal', function ( e ) {
 | 
			
		||||
          this.$element.on('keyup.dismiss.modal', function ( e ) {
 | 
			
		||||
            e.which == 27 && that.hide()
 | 
			
		||||
          })
 | 
			
		||||
        } else if (!this.isShown) {
 | 
			
		||||
          $(document).off('keyup.dismiss.modal')
 | 
			
		||||
          this.$element.off('keyup.dismiss.modal')
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -946,7 +951,12 @@
 | 
			
		|||
        , option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
 | 
			
		||||
 | 
			
		||||
      e.preventDefault()
 | 
			
		||||
      $target.modal(option)
 | 
			
		||||
 | 
			
		||||
      $target
 | 
			
		||||
        .modal(option)        
 | 
			
		||||
        .one('hide', function () {
 | 
			
		||||
          $this.focus()
 | 
			
		||||
        })
 | 
			
		||||
    })
 | 
			
		||||
  })
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| 
						 | 
				
			
			@ -183,7 +183,7 @@ $('#myModal').on('show', function (e) {
 | 
			
		|||
          <div class="bs-docs-example" style="background-color: #f5f5f5;">
 | 
			
		||||
            <div class="modal" style="position: relative; top: auto; left: auto; margin: 0 auto 20px; z-index: 1; max-width: 100%;">
 | 
			
		||||
              <div class="modal-header">
 | 
			
		||||
                <button type="button" class="close" data-dismiss="modal">×</button>
 | 
			
		||||
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
 | 
			
		||||
                <h3>Modal header</h3>
 | 
			
		||||
              </div>
 | 
			
		||||
              <div class="modal-body">
 | 
			
		||||
| 
						 | 
				
			
			@ -198,7 +198,7 @@ $('#myModal').on('show', function (e) {
 | 
			
		|||
<pre class="prettyprint linenums">
 | 
			
		||||
<div class="modal hide fade">
 | 
			
		||||
  <div class="modal-header">
 | 
			
		||||
    <button type="button" class="close" data-dismiss="modal">&times;</button>
 | 
			
		||||
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
 | 
			
		||||
    <h3>Modal header</h3>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="modal-body">
 | 
			
		||||
| 
						 | 
				
			
			@ -214,9 +214,9 @@ $('#myModal').on('show', function (e) {
 | 
			
		|||
          <h3>Live demo</h3>
 | 
			
		||||
          <p>Toggle a modal via javascript by clicking the button below. It will slide down and fade in from the top of the page.</p>
 | 
			
		||||
          <!-- sample modal content -->
 | 
			
		||||
          <div id="myModal" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
 | 
			
		||||
          <div id="myModal" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
 | 
			
		||||
            <div class="modal-header">
 | 
			
		||||
              <button type="button" class="close" data-dismiss="modal">×</button>
 | 
			
		||||
              <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
 | 
			
		||||
              <h3 id="myModalLabel">Modal Heading</h3>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="modal-body">
 | 
			
		||||
| 
						 | 
				
			
			@ -241,8 +241,8 @@ $('#myModal').on('show', function (e) {
 | 
			
		|||
              <p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="modal-footer">
 | 
			
		||||
              <a href="#" role="button" class="btn" data-dismiss="modal" >Close</a>
 | 
			
		||||
              <a href="#" role="button" class="btn btn-primary">Save changes</a>
 | 
			
		||||
              <button class="btn" data-dismiss="modal">Close</button>
 | 
			
		||||
              <button class="btn btn-primary">Save changes</button>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
          <div class="bs-docs-example" style="padding-bottom: 24px;">
 | 
			
		||||
| 
						 | 
				
			
			@ -253,17 +253,17 @@ $('#myModal').on('show', function (e) {
 | 
			
		|||
<a href="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a>
 | 
			
		||||
 | 
			
		||||
<-- Modal -->
 | 
			
		||||
<div class="modal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
 | 
			
		||||
<div class="modal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
 | 
			
		||||
  <div class="modal-header">
 | 
			
		||||
    <button type="button" class="close" data-dismiss="modal">×</button>
 | 
			
		||||
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
 | 
			
		||||
    <h3 id="myModalLabel">Modal header</h3>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="modal-body">
 | 
			
		||||
    <p>One fine body…</p>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="modal-footer">
 | 
			
		||||
    <a href="#" role="button" class="btn">Close</a>
 | 
			
		||||
    <a href="#" role="button" class="btn btn-primary">Save changes</a>
 | 
			
		||||
    <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
 | 
			
		||||
    <button class="btn btn-primary">Save changes</button>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
</pre>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -113,7 +113,7 @@ $('#myModal').on('show', function (e) {
 | 
			
		|||
          <div class="bs-docs-example" style="background-color: #f5f5f5;">
 | 
			
		||||
            <div class="modal" style="position: relative; top: auto; left: auto; margin: 0 auto 20px; z-index: 1; max-width: 100%;">
 | 
			
		||||
              <div class="modal-header">
 | 
			
		||||
                <button type="button" class="close" data-dismiss="modal">×</button>
 | 
			
		||||
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
 | 
			
		||||
                <h3>{{_i}}Modal header{{/i}}</h3>
 | 
			
		||||
              </div>
 | 
			
		||||
              <div class="modal-body">
 | 
			
		||||
| 
						 | 
				
			
			@ -128,7 +128,7 @@ $('#myModal').on('show', function (e) {
 | 
			
		|||
<pre class="prettyprint linenums">
 | 
			
		||||
<div class="modal hide fade">
 | 
			
		||||
  <div class="modal-header">
 | 
			
		||||
    <button type="button" class="close" data-dismiss="modal">&times;</button>
 | 
			
		||||
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
 | 
			
		||||
    <h3>{{_i}}Modal header{{/i}}</h3>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="modal-body">
 | 
			
		||||
| 
						 | 
				
			
			@ -144,9 +144,9 @@ $('#myModal').on('show', function (e) {
 | 
			
		|||
          <h3>{{_i}}Live demo{{/i}}</h3>
 | 
			
		||||
          <p>{{_i}}Toggle a modal via javascript by clicking the button below. It will slide down and fade in from the top of the page.{{/i}}</p>
 | 
			
		||||
          <!-- sample modal content -->
 | 
			
		||||
          <div id="myModal" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
 | 
			
		||||
          <div id="myModal" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
 | 
			
		||||
            <div class="modal-header">
 | 
			
		||||
              <button type="button" class="close" data-dismiss="modal">×</button>
 | 
			
		||||
              <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
 | 
			
		||||
              <h3 id="myModalLabel">{{_i}}Modal Heading{{/i}}</h3>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="modal-body">
 | 
			
		||||
| 
						 | 
				
			
			@ -171,8 +171,8 @@ $('#myModal').on('show', function (e) {
 | 
			
		|||
              <p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="modal-footer">
 | 
			
		||||
              <a href="#" role="button" class="btn" data-dismiss="modal" >{{_i}}Close{{/i}}</a>
 | 
			
		||||
              <a href="#" role="button" class="btn btn-primary">{{_i}}Save changes{{/i}}</a>
 | 
			
		||||
              <button class="btn" data-dismiss="modal">{{_i}}Close{{/i}}</button>
 | 
			
		||||
              <button class="btn btn-primary">{{_i}}Save changes{{/i}}</button>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
          <div class="bs-docs-example" style="padding-bottom: 24px;">
 | 
			
		||||
| 
						 | 
				
			
			@ -183,17 +183,17 @@ $('#myModal').on('show', function (e) {
 | 
			
		|||
<a href="#myModal" role="button" class="btn" data-toggle="modal">{{_i}}Launch demo modal{{/i}}</a>
 | 
			
		||||
 | 
			
		||||
<-- Modal -->
 | 
			
		||||
<div class="modal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
 | 
			
		||||
<div class="modal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
 | 
			
		||||
  <div class="modal-header">
 | 
			
		||||
    <button type="button" class="close" data-dismiss="modal">×</button>
 | 
			
		||||
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
 | 
			
		||||
    <h3 id="myModalLabel">Modal header</h3>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="modal-body">
 | 
			
		||||
    <p>{{_i}}One fine body…{{/i}}</p>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="modal-footer">
 | 
			
		||||
    <a href="#" role="button" class="btn">{{_i}}Close{{/i}}</a>
 | 
			
		||||
    <a href="#" role="button" class="btn btn-primary">{{_i}}Save changes{{/i}}</a>
 | 
			
		||||
    <button class="btn" data-dismiss="modal" aria-hidden="true">{{_i}}Close{{/i}}</button>
 | 
			
		||||
    <button class="btn btn-primary">{{_i}}Save changes{{/i}}</button>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
</pre>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -69,7 +69,10 @@
 | 
			
		|||
            that.$element[0].offsetWidth // force reflow
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
          that.$element.addClass('in')
 | 
			
		||||
          that.$element
 | 
			
		||||
            .addClass('in')
 | 
			
		||||
            .attr('aria-hidden', false)
 | 
			
		||||
            .focus()
 | 
			
		||||
 | 
			
		||||
          that.enforceFocus()
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -99,7 +102,9 @@
 | 
			
		|||
 | 
			
		||||
        $(document).off('focusin.modal')
 | 
			
		||||
 | 
			
		||||
        this.$element.removeClass('in')
 | 
			
		||||
        this.$element
 | 
			
		||||
          .removeClass('in')
 | 
			
		||||
          .attr('aria-hidden', true)
 | 
			
		||||
 | 
			
		||||
        $.support.transition && this.$element.hasClass('fade') ?
 | 
			
		||||
          this.hideWithTransition() :
 | 
			
		||||
| 
						 | 
				
			
			@ -118,11 +123,11 @@
 | 
			
		|||
    , escape: function () {
 | 
			
		||||
        var that = this
 | 
			
		||||
        if (this.isShown && this.options.keyboard) {
 | 
			
		||||
          $(document).on('keyup.dismiss.modal', function ( e ) {
 | 
			
		||||
          this.$element.on('keyup.dismiss.modal', function ( e ) {
 | 
			
		||||
            e.which == 27 && that.hide()
 | 
			
		||||
          })
 | 
			
		||||
        } else if (!this.isShown) {
 | 
			
		||||
          $(document).off('keyup.dismiss.modal')
 | 
			
		||||
          this.$element.off('keyup.dismiss.modal')
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -222,7 +227,12 @@
 | 
			
		|||
        , option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
 | 
			
		||||
 | 
			
		||||
      e.preventDefault()
 | 
			
		||||
      $target.modal(option)
 | 
			
		||||
 | 
			
		||||
      $target
 | 
			
		||||
        .modal(option)        
 | 
			
		||||
        .one('hide', function () {
 | 
			
		||||
          $this.focus()
 | 
			
		||||
        })
 | 
			
		||||
    })
 | 
			
		||||
  })
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue