diff --git a/src/skin/js/CRMJSOM.js b/src/skin/js/CRMJSOM.js index b73106449..ae364c23d 100644 --- a/src/skin/js/CRMJSOM.js +++ b/src/skin/js/CRMJSOM.js @@ -1727,6 +1727,21 @@ window.CRM.ElementListener = function(element, type, callback) { }); } +window.CRM.addClass = function(element, c = "btn-default") { + // this is pure vanillia code ;-) + document.querySelectorAll(element).forEach(el=>{ + el.classList.add(c); + }); +} + +window.CRM.removeClass = function(element, c = "btn-default") { + // this is pure vanillia code ;-) + document.querySelectorAll(element).forEach(el=>{ + el.classList.remove(c); + }); +} + + $(document).ajaxError(function (evt, xhr, settings,errortext) { if(errortext !== "abort") { try {