FEATURE: add working confirm dialog
This commit is contained in:
+11
-2
@@ -9520,11 +9520,11 @@ pre code {
|
||||
border-bottom-width: 2px;
|
||||
}
|
||||
|
||||
.table-striped tbody tr:nth-of-type(odd) {
|
||||
.table-striped tbody tr:nth-of-type(odd), .rows-striped .row:nth-of-type(odd) {
|
||||
background-color: #F9F9F9;
|
||||
}
|
||||
|
||||
.table-hover tbody tr:hover {
|
||||
.table-hover tbody tr:hover, .rows-striped .row:hover {
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
@@ -14371,3 +14371,12 @@ img {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.p-tb-15 {
|
||||
padding-top: 15px;
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
@@ -1346,7 +1346,6 @@ $ (function () {
|
||||
|
||||
});
|
||||
|
||||
|
||||
$ (function () {
|
||||
|
||||
$ ("body").addClass ("loaded");
|
||||
@@ -1364,7 +1363,6 @@ $ (function () {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Makes slug from input string
|
||||
*
|
||||
@@ -1401,15 +1399,36 @@ function slugify(text, trimSpaces) {
|
||||
|
||||
// bind some custom methods
|
||||
$ (document).ready (function () {
|
||||
$ ('.confirm').click (function () {
|
||||
var confirmMessage = $ (this).data ('confirm-message');
|
||||
var previousTitle, previousMessage;
|
||||
|
||||
// set some default message
|
||||
if (typeof confirmMessage == 'undefined') {
|
||||
confirmMessage = 'Really?';
|
||||
}
|
||||
$ ('.confirm').click (function (e) {
|
||||
|
||||
return confirm (confirmMessage);
|
||||
var titleElement = $ ('#confirmation-title');
|
||||
var messageElement = $ ('#confirmation-message');
|
||||
|
||||
previousTitle = titleElement.text ();
|
||||
previousMessage = messageElement.text ();
|
||||
|
||||
var confirmTitle = $ (this).data ('title');
|
||||
var confirmMessage = $ (this).data ('message');
|
||||
var href = $ (this).attr ('href');
|
||||
|
||||
$ ('#confirm-button').attr ('href', href);
|
||||
|
||||
if (confirmTitle)
|
||||
titleElement.text (confirmTitle);
|
||||
|
||||
if (confirmMessage)
|
||||
messageElement.text (confirmMessage);
|
||||
|
||||
$ ('#confirm-modal').modal ('show');
|
||||
|
||||
e.preventDefault ();
|
||||
});
|
||||
|
||||
$ ('#confirm-modal').on ('hidden.bs.modal', function () {
|
||||
$ ('#confirmation-title').text (previousTitle);
|
||||
$ ('#confirmation-message').text (previousMessage);
|
||||
});
|
||||
|
||||
$ ('#lockUrl').change (function () {
|
||||
@@ -1432,7 +1451,7 @@ $ (document).ready (function () {
|
||||
|
||||
$ (function () {
|
||||
$ ('[data-toggle="tooltip"]').tooltip ()
|
||||
})
|
||||
});
|
||||
|
||||
// find if any error occured and mark tab with that error
|
||||
$ ('.has-error').each (function () {
|
||||
@@ -1443,9 +1462,6 @@ $ (document).ready (function () {
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
/***********************************************
|
||||
* NProgress Settings
|
||||
***********************************************/
|
||||
|
||||
@@ -2,5 +2,9 @@
|
||||
return [
|
||||
'admin' => 'Administration',
|
||||
'logout' => 'Log out',
|
||||
'logoutSuccessfull' => 'Logout was successfull.'
|
||||
'logoutSuccessfull' => 'Logout was successfull.',
|
||||
'yes' => 'Yes',
|
||||
'no' => 'No',
|
||||
'confirmationTitle' => 'Really?',
|
||||
'confirmation' => 'Do you really want to perform this action?',
|
||||
];
|
||||
@@ -53,27 +53,29 @@
|
||||
<div class="modal fade" id="confirm-modal">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title"><i class="fa fa-warning"></i> Alert</h4> </div>
|
||||
<h4 class="modal-title">
|
||||
<i class="fa fa-warning"></i>
|
||||
<span id="confirmation-title">@lang('admin/common.confirmationTitle')</span>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Are you sure want to do this?</p>
|
||||
<p id="confirmation-message">@lang('admin/common.confirmation')</p>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<a id="confirm-button" class="btn btn-primary">@lang('admin/common.yes')</a>
|
||||
<button id="cancel-modal-button" type="button" class="btn btn-secondary" data-dismiss="modal">@lang('admin/common.no')</button>
|
||||
</div>
|
||||
<div class="modal-footer"> <button type="button" class="btn btn-primary" data-dismiss="modal">Yes</button> <button type="button" class="btn btn-secondary" data-dismiss="modal">No</button> </div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
<div class="ref" id="ref">
|
||||
<div class="color-primary"></div>
|
||||
<div class="chart">
|
||||
<div class="color-primary"></div>
|
||||
<div class="color-secondary"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="{{asset('resources/assets/admin/js')}}/vendor.js"></script>
|
||||
<script src="{{asset('resources/assets/admin/js')}}/app.js"></script>
|
||||
@yield('javascripts')
|
||||
|
||||
@@ -156,7 +156,7 @@
|
||||
<div class="footer-block author">
|
||||
<ul>
|
||||
<li>
|
||||
© {{date('Y')}} <a href="https://binarity.cz">binarity s.r.o.</a>
|
||||
© {{date('Y')}} <a href="https://www.binarity.cz">binarity s.r.o.</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://github.com/modularcode">ModularCode</a>
|
||||
|
||||
Reference in New Issue
Block a user