mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-28 14:29:07 +02:00
add jshint support + a few minor stylistic changes
This commit is contained in:
21
js/bootstrap-modal.js
vendored
21
js/bootstrap-modal.js
vendored
@@ -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 );
|
||||
}(window.jQuery);
|
Reference in New Issue
Block a user