From e05d39d4ccaadb750d251a268adbeef681472029 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Sat, 27 Aug 2011 18:03:01 -0700 Subject: make generic fade animation css class --- examples/assets/js/bootstrap-alerts.js | 4 ++-- examples/assets/js/bootstrap-modal.js | 19 +++++++++++-------- examples/assets/js/bootstrap-twipsy.js | 14 ++++++++++---- examples/bootstrap-js.html | 12 +++++++----- 4 files changed, 30 insertions(+), 19 deletions(-) (limited to 'examples') diff --git a/examples/assets/js/bootstrap-alerts.js b/examples/assets/js/bootstrap-alerts.js index d1983d9f7..f6a5f9711 100644 --- a/examples/assets/js/bootstrap-alerts.js +++ b/examples/assets/js/bootstrap-alerts.js @@ -51,11 +51,11 @@ that.$element = null } - $.support.transition ? + $.support.transition && this.$element.hasClass('fade') ? this.$element.bind(transitionEnd, removeElement) : removeElement() - this.$element.removeClass('show') + this.$element.removeClass('in') } } diff --git a/examples/assets/js/bootstrap-modal.js b/examples/assets/js/bootstrap-modal.js index 0b13fdf58..8e782a37e 100644 --- a/examples/assets/js/bootstrap-modal.js +++ b/examples/assets/js/bootstrap-modal.js @@ -55,17 +55,19 @@ var that = this this.isOpen = true + this.$element = $(this.settings.content) + _.escape.call(this) _.backdrop.call(this) - this.$element = $(this.settings.content) + this.$element .delegate('.close', 'click', function (e) { e.preventDefault(); that.close() }) .appendTo(document.body) .show() setTimeout(function () { - that.$element.addClass('show') - that.$backdrop && that.$backdrop.addClass('show') + that.$element.addClass('in') + that.$backdrop && that.$backdrop.addClass('in') }, 1) return this @@ -79,14 +81,14 @@ _.escape.call(this) _.backdrop.call(this) - this.$element.removeClass('show') + this.$element.removeClass('in') function removeElement () { that.$element.remove() that.$element = null } - $.support.transition ? + $.support.transition && this.$element.hasClass('fade') ? this.$element.bind(transitionEnd, removeElement) : removeElement() @@ -103,19 +105,20 @@ backdrop: function () { var that = this + , animate = this.$element.hasClass('fade') ? 'fade' : '' if ( this.isOpen && this.settings.backdrop ) { - this.$backdrop = $('