diff --git a/static/js/directives/screenshare.js b/static/js/directives/screenshare.js index b868cb89..0b069375 100644 --- a/static/js/directives/screenshare.js +++ b/static/js/directives/screenshare.js @@ -172,7 +172,7 @@ define(['jquery', 'underscore', 'text!partials/screenshare.html', 'text!partials } $scope.layout.screenshare = true; - screensharing.globalNotify().screensharingStart(); + screensharing.globalNotify.screensharingStart(); screensharing.getScreen().then(function(options) { if (options) { $scope.startScreenshare(options); @@ -308,7 +308,7 @@ define(['jquery', 'underscore', 'text!partials/screenshare.html', 'text!partials $scope.layout.screenshare = false; } - screensharing.globalNotify().screensharingStop(); + screensharing.globalNotify.screensharingStop(); }; diff --git a/static/js/services/screensharing.js b/static/js/services/screensharing.js index 3bdb43c3..6827dd97 100644 --- a/static/js/services/screensharing.js +++ b/static/js/services/screensharing.js @@ -51,15 +51,13 @@ define(['underscore', 'text!partials/screensharedialogff.html', 'webrtc.adapter' }, this)); }; - Screensharing.prototype.globalNotify = function() { - return { - screensharingStart: function() { - $window.dispatchEvent(GLOBAL_SCREENSHARING_START_EVENT); - }, - screensharingStop: function() { - $window.dispatchEvent(GLOBAL_SCREENSHARING_STOP_EVENT); - } - }; + Screensharing.prototype.globalNotify = { + screensharingStart: function() { + $window.dispatchEvent(GLOBAL_SCREENSHARING_START_EVENT); + }, + screensharingStop: function() { + $window.dispatchEvent(GLOBAL_SCREENSHARING_STOP_EVENT); + } }; Screensharing.prototype.initialize = function() { @@ -76,7 +74,7 @@ define(['underscore', 'text!partials/screensharedialogff.html', 'webrtc.adapter' // To work, the current domain must be whitelisted in // media.getusermedia.screensharing.allowed_domains (about:config). // See https://wiki.mozilla.org/Screensharing for reference. - that.globalNotify().screensharingStart(); + that.globalNotify.screensharingStart(); var d = $q.defer(); var dlg = dialogs.create('/dialogs/screensharedialogff.html', screenshareDialogFFController, {selection: "screen"}, {}); dlg.result.then(function(source) {