1
0
Fork 0
mirror of https://github.com/gorhill/uMatrix.git synced 2024-06-29 11:30:20 +12:00

Code styling

This commit is contained in:
Deathamns 2014-12-28 21:26:06 +01:00 committed by gorhill
parent 5ec2e067df
commit 3d40e0b2aa

View file

@ -55,7 +55,7 @@ var messagingConnector = function(response) {
var channels = vAPI.messaging.channels;
var channel, listener;
if ( response.broadcast === true && !response.portName ) {
if ( response.broadcast === true && !response.channelName ) {
for ( channel in channels ) {
if ( channels.hasOwnProperty(channel) === false ) {
continue;
@ -75,7 +75,7 @@ var messagingConnector = function(response) {
}
if ( !listener ) {
channel = channels[response.portName];
channel = channels[response.channelName];
listener = channel && channel.listener;
}
@ -121,7 +121,7 @@ vAPI.messaging = {
}
this.channels[channelName] = {
portName: channelName,
channelName: channelName,
listener: typeof callback === 'function' ? callback : null,
send: function(message, callback) {
if ( vAPI.messaging.port === null ) {
@ -129,7 +129,7 @@ vAPI.messaging = {
}
message = {
portName: this.portName,
channelName: this.channelName,
msg: message
};
@ -141,7 +141,7 @@ vAPI.messaging = {
vAPI.messaging.port.postMessage(message);
},
close: function() {
delete vAPI.messaging.channels[this.portName];
delete vAPI.messaging.channels[this.channelName];
}
};