diff options
| author | Mark Otto <[email protected]> | 2012-04-14 17:16:37 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2012-04-14 17:16:37 -0700 |
| commit | ce30d19c1507e71199f7dbbf680cf0d2b0ea6477 (patch) | |
| tree | 1279731abc8cf141a3fd683282ad2cae32ae6653 /js/bootstrap-modal.js | |
| parent | dbde2dc9e40f077af4fcaa1714ade7bc94398da9 (diff) | |
| parent | 3408064d00bc1e4322c3ea1575bc2cab5aaa2be2 (diff) | |
| download | bootstrap-ce30d19c1507e71199f7dbbf680cf0d2b0ea6477.tar.xz bootstrap-ce30d19c1507e71199f7dbbf680cf0d2b0ea6477.zip | |
Merge branch '2.0.3-wip' of github.com:twitter/bootstrap into 2.0.3-wip
Conflicts:
docs/assets/bootstrap.zip
Diffstat (limited to 'js/bootstrap-modal.js')
| -rw-r--r-- | js/bootstrap-modal.js | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js index f16b56500..959433f2a 100644 --- a/js/bootstrap-modal.js +++ b/js/bootstrap-modal.js @@ -18,14 +18,15 @@ * ========================================================= */ -!function ( $ ) { +!function ($) { + + "use strict"; // jshint ;_; - "use strict" /* MODAL CLASS DEFINITION * ====================== */ - var Modal = function ( content, options ) { + var Modal = function (content, options) { this.options = options this.$element = $(content) .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this)) @@ -55,7 +56,9 @@ backdrop.call(this, function () { var transition = $.support.transition && that.$element.hasClass('fade') - !that.$element.parent().length && that.$element.appendTo(document.body) //don't move modals dom position + if (!that.$element.parent().length) { + that.$element.appendTo(document.body) //don't move modals dom position + } that.$element .show() @@ -73,7 +76,7 @@ }) } - , hide: function ( e ) { + , hide: function (e) { e && e.preventDefault() var that = this @@ -116,7 +119,7 @@ }) } - function hideModal( that ) { + function hideModal(that) { this.$element .hide() .trigger('hidden') @@ -124,7 +127,7 @@ backdrop.call(this) } - function backdrop( callback ) { + function backdrop(callback) { var that = this , animate = this.$element.hasClass('fade') ? 'fade' : '' @@ -178,7 +181,7 @@ /* MODAL PLUGIN DEFINITION * ======================= */ - $.fn.modal = function ( option ) { + $.fn.modal = function (option) { return this.each(function () { var $this = $(this) , data = $this.data('modal') @@ -212,4 +215,4 @@ }) }) -}( window.jQuery );
\ No newline at end of file +}(window.jQuery);
\ No newline at end of file |
