Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

add remoteload event #5490

Closed
wants to merge 1 commit into from

2 participants

@cielavenir

I'd like Modal Header to be changed dynamically, as described in
http://jsrun.it/cielavenir/modaltest

@cielavenir

In this case, this code is actually enough...

document.getElementById('html_modal').onajaxSuccess=function(){
    document.getElementById('htmlModalLabel').innerText=document.getElementById('modal_title').innerText;
};
document.getElementById('html_modal').onhidden=function(){
    $(this).removeData('modal');
    $('#htmlModalLabel').text('title');
    $('#htmlModalBody').html('<p class="text-info">connecting...</p>');
}

The key is ajaxSuccess event.

@fat
Owner

please make pull requests against -wip branches thanks!

@fat fat closed this
@cielavenir

Well, excuse me, but am I allowed to send pull request against master branch?

@cielavenir

Oops in this project wip branch isn't master... I didn't know.
Anyway considering jtward's issue is also closed, this doesn't need to be reopened...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 11, 2012
  1. @cielavenir

    add remoteload event

    cielavenir authored
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 2 deletions.
  1. +5 −2 js/bootstrap-modal.js
View
7 js/bootstrap-modal.js
@@ -30,7 +30,10 @@
this.options = options
this.$element = $(element)
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
- this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
+ var elem=this.$element;
+ this.options.remote && this.$element.find('.modal-body').load(this.options.remote,
+ function(responseText, textStatus, xhr){elem.trigger('remoteload');}
+ )
}
Modal.prototype = {
@@ -236,4 +239,4 @@
})
})
-}(window.jQuery);
+}(window.jQuery);
Something went wrong with that request. Please try again.