Skip to content

Instantly share code, notes, and snippets.

@borantula
Created August 3, 2015 09:46
Show Gist options
  • Save borantula/7e91f79d463434b7b122 to your computer and use it in GitHub Desktop.
Save borantula/7e91f79d463434b7b122 to your computer and use it in GitHub Desktop.
Bootstrap Modal Control Class for easy usage
BootstrapModalControl = {
init : function(){
//for necessary binding
},
modelBox : function(){
//this could be dynamic if you have more than one modal
return $('#admin-modal');
},
open : function(){
this.clearContent();
this.modelBox().modal();
return this;
},
content : function(html){
this.modelBox().find('.modal-body').html(html);
return this;
},
clearContent : function(){
this.content('');
},
close : function(){
this.modelBox().modal('hide');
this.clearContent();
return this;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment