mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1159199 - Clicking the context indicator in the Loop panel should close the panel after opening the url. r=mikedeboer
This commit is contained in:
parent
ce4b360fc0
commit
5f9517ba60
@ -432,6 +432,8 @@ loop.panel = (function(_, mozL10n) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
var RoomEntryContextItem = React.createClass({displayName: "RoomEntryContextItem",
|
var RoomEntryContextItem = React.createClass({displayName: "RoomEntryContextItem",
|
||||||
|
mixins: [loop.shared.mixins.WindowCloseMixin],
|
||||||
|
|
||||||
propTypes: {
|
propTypes: {
|
||||||
mozLoop: React.PropTypes.object.isRequired,
|
mozLoop: React.PropTypes.object.isRequired,
|
||||||
roomUrls: React.PropTypes.object
|
roomUrls: React.PropTypes.object
|
||||||
@ -441,6 +443,7 @@ loop.panel = (function(_, mozL10n) {
|
|||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
this.props.mozLoop.openURL(event.currentTarget.href);
|
this.props.mozLoop.openURL(event.currentTarget.href);
|
||||||
|
this.closeWindow();
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
|
@ -432,6 +432,8 @@ loop.panel = (function(_, mozL10n) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
var RoomEntryContextItem = React.createClass({
|
var RoomEntryContextItem = React.createClass({
|
||||||
|
mixins: [loop.shared.mixins.WindowCloseMixin],
|
||||||
|
|
||||||
propTypes: {
|
propTypes: {
|
||||||
mozLoop: React.PropTypes.object.isRequired,
|
mozLoop: React.PropTypes.object.isRequired,
|
||||||
roomUrls: React.PropTypes.object
|
roomUrls: React.PropTypes.object
|
||||||
@ -441,6 +443,7 @@ loop.panel = (function(_, mozL10n) {
|
|||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
this.props.mozLoop.openURL(event.currentTarget.href);
|
this.props.mozLoop.openURL(event.currentTarget.href);
|
||||||
|
this.closeWindow();
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
|
@ -614,6 +614,20 @@ describe("loop.panel", function() {
|
|||||||
sinon.assert.calledOnce(fakeMozLoop.openURL);
|
sinon.assert.calledOnce(fakeMozLoop.openURL);
|
||||||
sinon.assert.calledWithExactly(fakeMozLoop.openURL, "http://invalid/");
|
sinon.assert.calledWithExactly(fakeMozLoop.openURL, "http://invalid/");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should call close the panel after opening a url", function() {
|
||||||
|
roomData.decryptedContext.urls = [{
|
||||||
|
description: "invalid entry",
|
||||||
|
location: "http://invalid/",
|
||||||
|
thumbnail: "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="
|
||||||
|
}];
|
||||||
|
|
||||||
|
roomEntry = mountEntryForContext();
|
||||||
|
|
||||||
|
TestUtils.Simulate.click(roomEntry.getDOMNode().querySelector("a"));
|
||||||
|
|
||||||
|
sinon.assert.calledOnce(fakeWindow.close);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("Room Entry click", function() {
|
describe("Room Entry click", function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user