Merge pull request #973 from billmn/alert-improvements

Alert improvements
This commit is contained in:
James Brooks
2015-10-03 16:02:45 +01:00
10 changed files with 100 additions and 35 deletions

View File

@@ -16,6 +16,7 @@
"lodash": "~3.10.1",
"messenger": "~1.4.1",
"moment": "~2.10.6",
"Sortable": "~1.3.0"
"Sortable": "~1.3.0",
"sweetalert": "~1.1.0"
}
}

View File

@@ -7,6 +7,7 @@ elixir(function (mix) {
.sass('app.scss', 'public/dist/css/app.css')
.styles([
'vendor/bower_components/jquery-minicolors/jquery.minicolors.css',
'vendor/bower_components/sweetalert/dist/sweetalert.css',
'public/dist/css/app.css'
], 'public/dist/css/all.css', './')
.scripts([
@@ -23,6 +24,7 @@ elixir(function (mix) {
'vendor/bower_components/jquery-serialize-object/jquery.serialize-object.js',
'vendor/bower_components/chartjs/Chart.js',
'vendor/bower_components/jquery-sparkline/dist/jquery.sparkline.js',
'vendor/bower_components/sweetalert/dist/sweetalert.min.js',
'resources/assets/js/password-strength.js',
'resources/assets/js/app.js',
'resources/assets/js/**/*.js'

19
public/build/dist/css/all-1fd79ec356.css vendored Executable file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

19
public/build/dist/css/all-fbd1bacde1.css vendored Executable file

File diff suppressed because one or more lines are too long

16
public/build/dist/js/all-1c16482be2.js vendored Normal file

File diff suppressed because one or more lines are too long

16
public/build/dist/js/all-29dc2bf4b8.js vendored Executable file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
{
"dist/css/all.css": "dist/css/all-ae8c616187.css",
"dist/js/all.js": "dist/js/all-b77c8ca0d2.js"
"dist/css/all.css": "dist/css/all-fbd1bacde1.css",
"dist/js/all.js": "dist/js/all-1c16482be2.js"
}

View File

@@ -48,7 +48,17 @@ $(function() {
return methodForm;
})
.removeAttr('href')
.attr('onclick', ' if ($(this).hasClass(\'confirm-action\')) { if(confirm("Are you sure you want to do this?")) { $(this).find("form").submit(); } } else { $(this).find("form").submit(); }');
.on('click', function() {
var button = $(this);
if (button.hasClass('confirm-action')) {
askConfirmation(function() {
button.find("form").submit();
});
} else {
button.find("form").submit();
}
});
// Messenger config
Messenger.options = {
@@ -354,3 +364,16 @@ $(function() {
// Password strength
$('.password-strength').strengthify();
});
function askConfirmation(callback) {
swal({
type: "warning",
title: "Confirm your action",
text: "Are you sure you want to do this?",
confirmButtonText: "Yes",
confirmButtonColor: "#FF6F6F",
showCancelButton: true
}, function() {
callback();
});
}