aboutsummaryrefslogtreecommitdiff
path: root/js/bootstrap-modal.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/bootstrap-modal.js')
-rw-r--r--js/bootstrap-modal.js21
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