vendor/assets/javascripts/bootstrap-modal.js in bootstrap-modal-rails-2.1 vs vendor/assets/javascripts/bootstrap-modal.js in bootstrap-modal-rails-2.1.1
- old
+ new
@@ -56,11 +56,11 @@
show: function () {
var e = $.Event('show');
if (this.isShown) return;
- this.$element.triggerHandler(e);
+ this.$element.trigger(e);
if (e.isDefaultPrevented()) return;
this.escape();
@@ -72,11 +72,11 @@
hide: function (e) {
e && e.preventDefault();
e = $.Event('hide');
- this.$element.triggerHandler(e);
+ this.$element.trigger(e);
if (!this.isShown || e.isDefaultPrevented()) return (this.isShown = false);
this.isShown = false;
@@ -122,18 +122,18 @@
this.$element.find('.modal-body')
.css('overflow', '')
.css(prop, '');
- var modalOverflow = $(window).height() - 10 < this.$element.height();
-
if (value){
this.$element.find('.modal-body')
.css('overflow', 'auto')
.css(prop, value);
}
+ var modalOverflow = $(window).height() - 10 < this.$element.height();
+
if (modalOverflow || this.options.modalOverflow) {
this.$element
.css('margin-top', 0)
.addClass('modal-overflow');
} else {
@@ -202,11 +202,11 @@
},
hideModal: function () {
this.$element
.hide()
- .triggerHandler('hidden');
+ .trigger('hidden');
var prop = this.options.height ? 'height' : 'max-height';
var value = this.options.height || this.options.maxHeight;
if (value){
@@ -288,11 +288,11 @@
},
destroy: function () {
var e = $.Event('destroy');
- this.$element.triggerHandler(e);
+ this.$element.trigger(e);
if (e.isDefaultPrevented()) return;
this.teardown();
},
@@ -354,10 +354,10 @@
/* MODAL DATA-API
* ============== */
$(function () {
- $(document).off('.modal').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
+ $(document).off('click.modal').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
var $this = $(this),
href = $this.attr('href'),
$target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))), //strip for ie7
option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data());