mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 19:43:16 +00:00
Remove getters & setters
This commit is contained in:
@@ -13,7 +13,7 @@ define([
|
|||||||
// autobahn js is defined as a global object there is no way to load
|
// autobahn js is defined as a global object there is no way to load
|
||||||
// it as a UMD module
|
// it as a UMD module
|
||||||
ab.connect(url, function (session) {
|
ab.connect(url, function (session) {
|
||||||
that.setSession(session);
|
activeSession = session;
|
||||||
that.trigger("ws:connect", activeSession);
|
that.trigger("ws:connect", activeSession);
|
||||||
},
|
},
|
||||||
function (code, reason) {
|
function (code, reason) {
|
||||||
@@ -24,12 +24,12 @@ define([
|
|||||||
if (false === this.hasSession()) {
|
if (false === this.hasSession()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.getSession().close();
|
activeSession.close();
|
||||||
this.setSession(null);
|
activeSession = null;
|
||||||
this.trigger("ws:session-close");
|
this.trigger("ws:session-close");
|
||||||
},
|
},
|
||||||
hasSession: function() {
|
hasSession: function() {
|
||||||
return this.getSession() !== null;
|
return activeSession !== null;
|
||||||
},
|
},
|
||||||
subscribe: function(topic, callback) {
|
subscribe: function(topic, callback) {
|
||||||
if (false === this.hasSession()) {
|
if (false === this.hasSession()) {
|
||||||
@@ -39,14 +39,14 @@ define([
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.getSession().subscribe(topic, callback);
|
activeSession.subscribe(topic, callback);
|
||||||
this.trigger("ws:session-subscribe", topic);
|
this.trigger("ws:session-subscribe", topic);
|
||||||
},
|
},
|
||||||
unsubscribe: function(topic, callback) {
|
unsubscribe: function(topic, callback) {
|
||||||
if (false === this.hasSession()) {
|
if (false === this.hasSession()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.getSession().unsubscribe(topic, callback);
|
activeSession.unsubscribe(topic, callback);
|
||||||
this.trigger("ws:session-unsubscribe", topic);
|
this.trigger("ws:session-unsubscribe", topic);
|
||||||
}
|
}
|
||||||
}, Backbone.Events);
|
}, Backbone.Events);
|
||||||
|
Reference in New Issue
Block a user