1.0.3 • Published 5 years ago

jpag-main-modal v1.0.3

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

#Main modal control

Front script to manage Bootstrap modal windows.

###NPM ####Install in Your Project

npm install jpag-main-modal

####Link on your HTML

On your app.js:

const app = express()
app.use('/jpag-main-modal', express.static('node_modules/jpag-main-modal/index.js'));

On your HTML:

<script src="/jpag-main-modal"></script>

###CDN

<script src="https://cdn.jsdelivr.net/gh/Piteraguayo/jpag-main-modal/index.js"></script>

####CSS Use basic Bootstrap css or implement your own overwriting the classes.

####Usage

mainModal.showWithContent('Hello world');

RESULT:

Simple mesage

function onAcceptYourModal(){
	alert('YOU ACCEPTED THE MODAL');
	mainModal.hide();
}

function onCancelYourModal(){
	alert('YOU CANCELLED THE MODAL');
}

mainModal.showFooter=true;
mainModal.showCancel=true;
mainModal.acceptLabel='Save';
mainModal.onAccept= onAcceptYourModal;
mainModal.onCancel= onCancelYourModal;
mainModal.showWithContent('<span style="color:red">Do you want to delete the files?</span>');

RESULT:

Simple mesage

You can load async content by using

mainModal.showContentFromServer(urlYouWant);