mirror of
https://github.com/gorhill/uMatrix.git
synced 2024-09-30 09:06:56 +13:00
Code styling
This commit is contained in:
parent
5ec2e067df
commit
3d40e0b2aa
1 changed files with 5 additions and 5 deletions
|
@ -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];
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue