@sdetweil I’ve tried a few things and just am struggling with this notification received. Any advice with what I have so far?
/grabs information needed for refresh
notificationReceived: function (notification, payload, sender) {
if (notification === 'MODULE_DOM_CREATED') {
var modules = MM.getModules();
// Lists through all modules for testing.
for (var i = 0; i < modules.length; i++) {
// Check if the current module is the one.
if (modules[i].name === data.module) {
// Splits out the module number of the module with the same name.
var idnr = modules[i].data.identifier.split("_");
// Check if the idnum is an array or not
if (Array.isArray(data.idnum)) {
// If it's an array, check what numbers are in it.
var idnumber = data.idnum.find(function(element) {
// Number of the module is found in the array.
return element == idnr[1];
});
// If idnum is not an array.
} else {
// Set the module id to hide.
var idnumber = data.idnum;
}
// Hides the module.
modules[i].hide(self.config.animationSpeed, {force: self.config.allowForce});
// Sets the defined symbol for hidden module.
if (typeof data.symbol2 !== 'undefined') {
symbol.className = faclassName + data.symbol2;
// Set the size if it's set.
if (data.size) {
symbol.className += " fa-" + data.size;
symbol.className += data.size == 1 ? "g" : "x";
}
// Sets the defined image for hidden module.
} else if (typeof data.img2 !== 'undefined') {
image.className = "menubar-picture";
image.src = data.img2;
}
// Prints in the console what just happened (adding the ID).
console.log("Hiding "+modules[i].name+" ID: "+idnr[1]);
}}}
},