Skip to content

Commit

Permalink
do not expose private
Browse files Browse the repository at this point in the history
  • Loading branch information
GrosSacASac committed Oct 14, 2018
1 parent 34be62e commit 84d20bf
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/sandbox/sandbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ var Sandbox = function(module) {
this.module = module;
};

// All notifications from sandbox
Sandbox.notifications = {};
/**
* All notifications from sandbox
*
* @private
*/
var notifications = {};

/**
* Clear all notifications from an specific module
Expand All @@ -21,7 +25,7 @@ Sandbox.notifications = {};
* @param {string} module the name of the module
*/
Sandbox.clearNotifications = function(module) {
delete Sandbox.notifications[module];
delete notifications[module];
};

/**
Expand All @@ -31,8 +35,8 @@ Sandbox.clearNotifications = function(module) {
* @param {object} notification the object with notifications configs
*/
Sandbox.prototype.notify = function(notification) {
for(var module in Sandbox.notifications) {
var listening = Sandbox.notifications[module][notification.type];
for(var module in notifications) {
var listening = notifications[module][notification.type];
if(listening) {
listening.callback.call(listening.context, notification.data);
}
Expand Down Expand Up @@ -65,8 +69,7 @@ Sandbox.prototype.listen = function(notification) {
* @param {boolean} replace if the notification already exists, it forces to rewrite it
*/
Sandbox.prototype.addNotification = function(notification, callback, context, replace) {
var notifications = Sandbox.notifications,
addNotification = false;
var addNotification = false;

if(!notifications[this.module] || !notifications[this.module][notification]) {
addNotification = true;
Expand Down

0 comments on commit 84d20bf

Please sign in to comment.