In early 2014, I was introduced to Boostrap (front-end framework); 10 minutes later I was a true believer.
As I’ve been using Bootstrap for a while, there are a few customisations to controls and behaviours that I’ve implemented. In this series of articles (at least one) I’m going to share a few of these customisation. I won’t be modifying any Boostrap files. As always, these are my customisations they may not be to your liking.
This first part is about the Modals.
I like the Boostrap Modal but I’m more accustomed to injecting the Modal code in to the page on-demand. I want to load the Modal body through AJAX (with dynamic pages). I want to be able to launch a stack of Modals on a page. Finally, I want the code to clean itself away when the Modal is closed.
1. Create(id, title, url, is_big)
Creates the Modal on the page and loads the body from a URL. An existing box will be reused if the ID already exists.
BSDialog.Create("123", "My Modal Box 123", "/my-modal-box.html", true);
Close the Modal box by the box identifier.
Close all Modal boxes on the page.
4. ShowToast(id, title, message, is_big)
Creates a Modal box with a message provided.
BSDialog.ShowToast("123", "My Modal Box 123", "hello world", true);
Date: 14/07/2015 11:57