Skip to content

Commit

Permalink
Merge pull request #2620 from phili67/phili67-crmjsom-update-js
Browse files Browse the repository at this point in the history
CRMJSOM update : vanilla
  • Loading branch information
phili67 committed Apr 23, 2024
2 parents 98414d5 + 16bf098 commit 491834d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/skin/js/CRMJSOM.js
Expand Up @@ -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 {
Expand Down

0 comments on commit 491834d

Please sign in to comment.