mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1208047 - Close the dropdown menu for sharing on Loop's conversation window as soon as an item is clicked, rather than leaving it open in a potentially confusing state. r=mikedeboer
This commit is contained in:
parent
ec703b86f5
commit
8c53d8fd48
@ -120,10 +120,12 @@ loop.shared.views = (function(_, mozL10n) {
|
||||
|
||||
_handleShareTabs: function() {
|
||||
this._startScreenShare("browser");
|
||||
this.hideDropdownMenu();
|
||||
},
|
||||
|
||||
_handleShareWindows: function() {
|
||||
this._startScreenShare("window");
|
||||
this.hideDropdownMenu();
|
||||
},
|
||||
|
||||
_getTitle: function() {
|
||||
|
@ -120,10 +120,12 @@ loop.shared.views = (function(_, mozL10n) {
|
||||
|
||||
_handleShareTabs: function() {
|
||||
this._startScreenShare("browser");
|
||||
this.hideDropdownMenu();
|
||||
},
|
||||
|
||||
_handleShareWindows: function() {
|
||||
this._startScreenShare("window");
|
||||
this.hideDropdownMenu();
|
||||
},
|
||||
|
||||
_getTitle: function() {
|
||||
|
@ -176,6 +176,22 @@ describe("loop.shared.views", function() {
|
||||
new sharedActions.StartScreenShare({ type: "browser" }));
|
||||
});
|
||||
|
||||
it("should close the dropdown on 'browser' option click", function() {
|
||||
var comp = TestUtils.renderIntoDocument(
|
||||
React.createElement(sharedViews.ScreenShareControlButton, {
|
||||
dispatcher: dispatcher,
|
||||
visible: true,
|
||||
state: SCREEN_SHARE_STATES.INACTIVE
|
||||
}));
|
||||
|
||||
sandbox.stub(comp, "hideDropdownMenu");
|
||||
|
||||
TestUtils.Simulate.click(comp.getDOMNode().querySelector(
|
||||
".screen-share-menu > li"));
|
||||
|
||||
sinon.assert.calledOnce(comp.hideDropdownMenu);
|
||||
});
|
||||
|
||||
it("should dispatch a 'window' StartScreenShare action on option click",
|
||||
function() {
|
||||
var comp = TestUtils.renderIntoDocument(
|
||||
@ -193,6 +209,22 @@ describe("loop.shared.views", function() {
|
||||
new sharedActions.StartScreenShare({ type: "window" }));
|
||||
});
|
||||
|
||||
it("should close the dropdown on 'window' option click", function() {
|
||||
var comp = TestUtils.renderIntoDocument(
|
||||
React.createElement(sharedViews.ScreenShareControlButton, {
|
||||
dispatcher: dispatcher,
|
||||
visible: true,
|
||||
state: SCREEN_SHARE_STATES.INACTIVE
|
||||
}));
|
||||
|
||||
sandbox.stub(comp, "hideDropdownMenu");
|
||||
|
||||
TestUtils.Simulate.click(comp.getDOMNode().querySelector(
|
||||
".screen-share-menu > li:last-child"));
|
||||
|
||||
sinon.assert.calledOnce(comp.hideDropdownMenu);
|
||||
});
|
||||
|
||||
it("should have the 'window' option enabled", function() {
|
||||
var comp = TestUtils.renderIntoDocument(
|
||||
React.createElement(sharedViews.ScreenShareControlButton, {
|
||||
|
Loading…
Reference in New Issue
Block a user