Permalink
Browse files

Merge pull request #18 from m5o/2.0-wip

update to the edge v2.0
  • Loading branch information...
m5o committed Feb 11, 2012
2 parents f6c9973 + 16f2574 commit 4a2c6a721f88b596b6b46cba44fd51c8f312ff2d
View
Binary file not shown.
@@ -26,7 +26,7 @@
* ====================== */
var Modal = function ( content, options ) {
- this.options = $.extend({}, $.fn.modal.defaults, options)
+ this.options = options
this.$element = $(content)
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
}
@@ -177,16 +177,17 @@
return this.each(function () {
var $this = $(this)
, data = $this.data('modal')
- , options = typeof option == 'object' && option
+ , options = $.extend({}, $.fn.modal.defaults, typeof option == 'object' && option)
if (!data) $this.data('modal', (data = new Modal(this, options)))
if (typeof option == 'string') data[option]()
- else data.show()
+ else if (options.show) data.show()
})
}
$.fn.modal.defaults = {
backdrop: true
, keyboard: true
+ , show: true
}
$.fn.modal.Constructor = Modal
View
@@ -3,6 +3,7 @@
<head>
<meta charset="utf-8">
<title>Bootstrap, from Twitter</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
View
@@ -3,6 +3,7 @@
<head>
<meta charset="utf-8">
<title>Bootstrap, from Twitter</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
@@ -3,6 +3,7 @@
<head>
<meta charset="utf-8">
<title>Bootstrap, from Twitter</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
View
@@ -273,6 +273,12 @@ <h3>Options</h3>
<td>true</td>
<td>Closes the modal when escape key is pressed</td>
</tr>
+ <tr>
+ <td>show</td>
+ <td>boolean</td>
+ <td>true</td>
+ <td>Shows the modal when initialized.</td>
+ </tr>
</tbody>
</table>
<h3>Markup</h3>
@@ -197,6 +197,12 @@
<td>{{_i}}true{{/i}}</td>
<td>{{_i}}Closes the modal when escape key is pressed{{/i}}</td>
</tr>
+ <tr>
+ <td>{{_i}}show{{/i}}</td>
+ <td>{{_i}}boolean{{/i}}</td>
+ <td>{{_i}}true{{/i}}</td>
+ <td>{{_i}}Shows the modal when initialized.{{/i}}</td>
+ </tr>
</tbody>
</table>
<h3>{{_i}}Markup{{/i}}</h3>
@@ -169,6 +169,13 @@
<div class="alert alert-info">
<strong>{{_i}}Heads up!{{/i}}</strong> {{_i}}We're rewritten just about everything for our plugins, so head on over to <a href="./javascript.html">the Javascript page</a> to learn more.{{/i}}
</div>
+ <h3>{{_i}}Tooltips{{/i}}</h3>
+ <ul>
+ <li>{{_i}}The plugin method has been renamed from <code>twipsy()</code> to <code>tooltip()</code>, and the class name changed from <code>twipsy</code> to <code>tooltip</code>.{{/i}}</li>
+ <li>{{_i}}The <code>placement</code> option value that was <code>below</code> is now <code>bottom</code>, and <code>above</code> is now <code>top</code>.{{/i}}</li>
+ <li>{{_i}}The <code>animate</code> option was renamed to <code>animation</code>.{{/i}}</li>
+ <li>{{_i}}The <code>html</code> option was removed, as the tooltips default to allowing HTML now.{{/i}}</li>
+ </ul>
<h3>{{_i}}Popovers{{/i}}</h3>
<ul>
<li>{{_i}}Child elements now properly namespaced: <code>.title</code> to <code>.popover-title</code>, <code>.inner</code> to <code>.popover-inner</code>, and <code>.content</code> to <code>.popover-content</code>.{{/i}}</li>
View
@@ -26,7 +26,7 @@
* ====================== */
var Modal = function ( content, options ) {
- this.options = $.extend({}, $.fn.modal.defaults, options)
+ this.options = options
this.$element = $(content)
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
}
@@ -177,16 +177,17 @@
return this.each(function () {
var $this = $(this)
, data = $this.data('modal')
- , options = typeof option == 'object' && option
+ , options = $.extend({}, $.fn.modal.defaults, typeof option == 'object' && option)
if (!data) $this.data('modal', (data = new Modal(this, options)))
if (typeof option == 'string') data[option]()
- else data.show()
+ else if (options.show) data.show()
})
}
$.fn.modal.defaults = {
backdrop: true
, keyboard: true
+ , show: true
}
$.fn.modal.Constructor = Modal
@@ -13,7 +13,7 @@ $(function () {
test("should fade element out on clicking .close", function () {
var alertHTML = '<div class="alert-message warning fade in">'
+ '<a class="close" href="#" data-dismiss="alert">×</a>'
- + '<p><strong>Holy guacamole!</strong> Best check yo self, you're not looking too good.</p>'
+ + '<p><strong>Holy guacamole!</strong> Best check yo self, you\'re not looking too good.</p>'
+ '</div>'
, alert = $(alertHTML).alert()
@@ -27,7 +27,7 @@ $(function () {
var alertHTML = '<div class="alert-message warning fade in">'
+ '<a class="close" href="#" data-dismiss="alert">×</a>'
- + '<p><strong>Holy guacamole!</strong> Best check yo self, you're not looking too good.</p>'
+ + '<p><strong>Holy guacamole!</strong> Best check yo self, you\'re not looking too good.</p>'
+ '</div>'
, alert = $(alertHTML).appendTo('#qunit-fixture').alert()

0 comments on commit 4a2c6a7

Please sign in to comment.