Browse Source

Remove function from globalNotify and simply use dict.

pull/238/head
Evan Theurer 11 years ago
parent
commit
134ccaaa9c
  1. 4
      static/js/directives/screenshare.js
  2. 18
      static/js/services/screensharing.js

4
static/js/directives/screenshare.js

@ -172,7 +172,7 @@ define(['jquery', 'underscore', 'text!partials/screenshare.html', 'text!partials
} }
$scope.layout.screenshare = true; $scope.layout.screenshare = true;
screensharing.globalNotify().screensharingStart(); screensharing.globalNotify.screensharingStart();
screensharing.getScreen().then(function(options) { screensharing.getScreen().then(function(options) {
if (options) { if (options) {
$scope.startScreenshare(options); $scope.startScreenshare(options);
@ -308,7 +308,7 @@ define(['jquery', 'underscore', 'text!partials/screenshare.html', 'text!partials
$scope.layout.screenshare = false; $scope.layout.screenshare = false;
} }
screensharing.globalNotify().screensharingStop(); screensharing.globalNotify.screensharingStop();
}; };

18
static/js/services/screensharing.js

@ -51,15 +51,13 @@ define(['underscore', 'text!partials/screensharedialogff.html', 'webrtc.adapter'
}, this)); }, this));
}; };
Screensharing.prototype.globalNotify = function() { Screensharing.prototype.globalNotify = {
return { screensharingStart: function() {
screensharingStart: function() { $window.dispatchEvent(GLOBAL_SCREENSHARING_START_EVENT);
$window.dispatchEvent(GLOBAL_SCREENSHARING_START_EVENT); },
}, screensharingStop: function() {
screensharingStop: function() { $window.dispatchEvent(GLOBAL_SCREENSHARING_STOP_EVENT);
$window.dispatchEvent(GLOBAL_SCREENSHARING_STOP_EVENT); }
}
};
}; };
Screensharing.prototype.initialize = function() { 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 // To work, the current domain must be whitelisted in
// media.getusermedia.screensharing.allowed_domains (about:config). // media.getusermedia.screensharing.allowed_domains (about:config).
// See https://wiki.mozilla.org/Screensharing for reference. // See https://wiki.mozilla.org/Screensharing for reference.
that.globalNotify().screensharingStart(); that.globalNotify.screensharingStart();
var d = $q.defer(); var d = $q.defer();
var dlg = dialogs.create('/dialogs/screensharedialogff.html', screenshareDialogFFController, {selection: "screen"}, {}); var dlg = dialogs.create('/dialogs/screensharedialogff.html', screenshareDialogFFController, {selection: "screen"}, {});
dlg.result.then(function(source) { dlg.result.then(function(source) {

Loading…
Cancel
Save