Skip to content

Commit

Permalink
Incluir nuevos formularios de compras y ventas.
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel89fg committed Mar 11, 2022
1 parent 5e228e2 commit ab876f2
Show file tree
Hide file tree
Showing 53 changed files with 4,764 additions and 1,679 deletions.
313 changes: 0 additions & 313 deletions Core/Assets/JS/BusinessDocumentView.js

This file was deleted.

62 changes: 62 additions & 0 deletions Core/Assets/JS/Custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,68 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

function animateSpinner(animation, result = '') {
$(".btn-spin-action").each(function () {
let btn = $(this);
if (animation === 'add') {
btn.css('min-width', btn.width());
btn.css('min-height', btn.height());
btn.prop('disabled', true);
let oldHtml = btn.children('.old-html');
if (!oldHtml.length) {
btn.html('<span class="old-html">' + btn.html() + '</span>');
}
btn.append('<div class="spinner mx-auto" style="display: none;"><i class="fas fa-circle-notch fa-spin"></i></div>');
btn.find('.old-html').fadeOut(100, function () {
btn.find('.spinner').fadeIn();
});
}

let spinner = btn.children('.spinner');

if (spinner.data('animating')) {
spinner.removeClass(spinner.data('animating')).data('animating', null);
spinner.data('animationTimeout') && clearTimeout(spinner.data('animationTimeout'));
}

spinner.addClass('spinner-' + animation).data('animating', 'spinner-' + animation);
spinner.data('animationTimeout',
setTimeout(function () {
if (animation === 'remove') {
btn.find('.spinner').fadeOut(100, function () {
let attr = Boolean(btn.attr('load-after'));
if (result !== '' && typeof attr !== 'undefined' && attr === true) {
let icon = 'fas fa-times';
if (result) {
icon = 'fas fa-check';
}
btn.append('<div class="result mx-auto" style="display: none;"><i class="' + icon + '"></i></div>');
}

let checkResult = btn.children('.result');
if (checkResult.length) {
btn.find('.result').fadeIn();
setTimeout(function () {
btn.find('.result').fadeOut(200, function () {
btn.find('.old-html').fadeIn();
spinner.remove();
btn.find('.result').remove();
btn.prop('disabled', false);
});
}, 500);
} else {
btn.find('.old-html').fadeIn();
spinner.remove();
btn.prop('disabled', false);
}
});
}
},
parseFloat(spinner.css('animation-duration')) * 1000)
);
});
}

function confirmAction(viewName, action, title, message, cancel, confirm) {
bootbox.confirm({
title: title,
Expand Down
Loading

0 comments on commit ab876f2

Please sign in to comment.