test/dummy/node_modules/loco-js/dist/loco.js in loco-rails-3.0.0 vs test/dummy/node_modules/loco-js/dist/loco.js in loco-rails-3.0.1
- old
+ new
@@ -415,11 +415,11 @@
_createClass(Line, [{
key: 'connect',
value: function connect() {
var _this = this;
- return _channels2.default.Loco.NotificationCenter = (_deps.Deps.cable || App.cable).subscriptions.create({
+ return _channels2.default.Loco.NotificationCenter = _deps.Deps.cable.subscriptions.create({
channel: "Loco::NotificationCenterChannel"
}, {
connected: function connected() {
var wire;
console.log('ws connected');
@@ -513,13 +513,15 @@
}
}
}, {
key: '_sendNotification',
value: function _sendNotification(data) {
- var notificationCenter;
- notificationCenter = _deps.Deps.NotificationCenter != null ? new _deps.Deps.NotificationCenter() : new App.Services.NotificationCenter();
- return notificationCenter.receivedSignal(data);
+ if (_deps.Deps.NotificationCenter['receivedSignal'] != null) {
+ return _deps.Deps.NotificationCenter.receivedSignal(data);
+ } else {
+ return new _deps.Deps.NotificationCenter().receivedSignal(data);
+ }
}
}]);
return Line;
}();
@@ -1510,11 +1512,11 @@
});
}
}, {
key: 'initLine',
value: function initLine() {
- if (!(_deps.Deps.cable != null || (typeof App !== "undefined" && App !== null ? App.cable : void 0) != null)) {
+ if (_deps.Deps.cable == null) {
return;
}
this.line = new _line2.default();
return this.line.connect();
}
@@ -1530,26 +1532,41 @@
if (_controllers2.default[namespace_name] != null) {
_env2.default.namespaceController = new _controllers2.default[namespace_name]();
if (_controllers2.default[namespace_name][controller_name] != null) {
_env2.default.controller = new _controllers2.default[namespace_name][controller_name]();
}
+ if (_env2.default.namespaceController.constructor.initialize != null) {
+ _env2.default.namespaceController.constructor.initialize();
+ }
if (_env2.default.namespaceController.initialize != null) {
_env2.default.namespaceController.initialize();
}
if (_env2.default.controller != null) {
_env2.default.namespaceController.setSubController(_env2.default.controller);
_env2.default.controller.setSuperController(_env2.default.namespaceController);
+ if (_env2.default.controller.constructor.initialize != null) {
+ _env2.default.controller.constructor.initialize();
+ }
if (_env2.default.controller.initialize != null) {
_env2.default.controller.initialize();
}
+ if (_env2.default.controller.constructor[action_name] != null) {
+ _env2.default.controller.constructor[action_name]();
+ }
if (_env2.default.controller[action_name] != null) {
_env2.default.controller[action_name]();
}
}
} else if (_controllers2.default[controller_name]) {
_env2.default.controller = new _controllers2.default[controller_name]();
+ if (_env2.default.controller.constructor.initialize != null) {
+ _env2.default.controller.constructor.initialize();
+ }
if (_env2.default.controller.initialize != null) {
_env2.default.controller.initialize();
+ }
+ if (_env2.default.controller.constructor[action_name] != null) {
+ _env2.default.controller.constructor[action_name]();
}
if (_env2.default.controller[action_name] != null) {
_env2.default.controller[action_name]();
}
}
\ No newline at end of file