View on GitHub

ArmedButton

The Big Red Button made with MooTools

Download this project as a .zip file Download this project as a tar.gz file

What is ArmedButton?

ArmedButton is the product of looking for a way to spice up an otherwise boring day working on another project. It is confirmation button that looks and acts like the proverbial "Big Red Button" which gives you a chance to change your mind before you get an actual <button> to do something.

ArmedButton is based on MooTools (because I think it's awesome and is very much alive!) and Bootstrap 3.

How to use

Create your button:

				
and initialise it:
window.addEvent('domready', function(e){
	$$('.armable').armed({
		text: "Confirm",
		btnConfirm: {
			text: 'Confirm action',
			onConfirm: function(instance){
	//AB instance so you can do things like change the label and disarm
				instance.label.set('text', 'Action completed!');
				instance.disarm('btn btn-armed btn-block btn-success disabled');
			}
		},
		btnCancel: {
			text: 'Cancel'
		},

		fxOptions: {
			transition: 'pow:out',
			duration: 700
		}
	});
});

Result

Contact

Feel free to send your mods/fixes/constructive criticisms here: eugene.trotsan@gmail.com ;)