зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1262310 - Fix opening synced tabs from the sidebar. r=markh
MozReview-Commit-ID: 8VHbEqsyuF2 --HG-- extra : rebase_source : 04924f295134834cf66c0d9c4a31d43c614b3abf
This commit is contained in:
Родитель
ee27759c39
Коммит
b9d8f2d371
|
@ -107,7 +107,7 @@ TabListComponent.prototype = {
|
|||
},
|
||||
|
||||
onOpenTab(url, where, params) {
|
||||
this._window.openLinkIn(url, where, params);
|
||||
this._window.openUILinkIn(url, where, params);
|
||||
},
|
||||
|
||||
onCopyTabLocation(url) {
|
||||
|
|
|
@ -255,7 +255,7 @@ TabListView.prototype = {
|
|||
if (itemNode.classList.contains("tab")) {
|
||||
let url = itemNode.dataset.url;
|
||||
if (url) {
|
||||
this.props.onOpenTab(url, event);
|
||||
this.onOpenSelected(url, event);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -285,7 +285,7 @@ TabListView.prototype = {
|
|||
} else if (event.keyCode == this._window.KeyEvent.DOM_VK_RETURN) {
|
||||
let selectedNode = this.container.querySelector('.item.selected');
|
||||
if (selectedNode.dataset.url) {
|
||||
this.props.onOpenTab(selectedNode.dataset.url, event);
|
||||
this.onOpenSelected(selectedNode.dataset.url, event);
|
||||
} else if (selectedNode) {
|
||||
this.props.onToggleBranch(selectedNode.dataset.id);
|
||||
}
|
||||
|
@ -307,7 +307,12 @@ TabListView.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
onOpenSelected(event) {
|
||||
onOpenSelected(url, event) {
|
||||
let where = getChromeWindow(this._window).whereToOpenLink(event);
|
||||
this.props.onOpenTab(url, where, {});
|
||||
},
|
||||
|
||||
onOpenSelectedFromContextMenu(event) {
|
||||
let item = this._getSelectedTabNode();
|
||||
if (item) {
|
||||
let where = event.target.getAttribute("where");
|
||||
|
@ -422,7 +427,7 @@ TabListView.prototype = {
|
|||
case "syncedTabsOpenSelectedInTab":
|
||||
case "syncedTabsOpenSelectedInWindow":
|
||||
case "syncedTabsOpenSelectedInPrivateWindow":
|
||||
this.onOpenSelected(event);
|
||||
this.onOpenSelectedFromContextMenu(event);
|
||||
break;
|
||||
case "syncedTabsBookmarkSelected":
|
||||
this.onBookmarkTab();
|
||||
|
|
|
@ -77,7 +77,7 @@ add_task(function* testActions() {
|
|||
},
|
||||
PlacesUtils: { bookmarksMenuFolderId: "id" }
|
||||
},
|
||||
openLinkIn() {}
|
||||
openUILinkIn() {}
|
||||
};
|
||||
let component = new TabListComponent({
|
||||
window: windowMock, store, View: null, SyncedTabs,
|
||||
|
@ -121,9 +121,9 @@ add_task(function* testActions() {
|
|||
Assert.equal(windowMock.top.PlacesCommandHook.bookmarkLink.args[0][1], "uri");
|
||||
Assert.equal(windowMock.top.PlacesCommandHook.bookmarkLink.args[0][2], "title");
|
||||
|
||||
sinon.spy(windowMock, "openLinkIn");
|
||||
sinon.spy(windowMock, "openUILinkIn");
|
||||
component.onOpenTab("uri", "where", "params");
|
||||
Assert.ok(windowMock.openLinkIn.calledWith("uri", "where", "params"));
|
||||
Assert.ok(windowMock.openUILinkIn.calledWith("uri", "where", "params"));
|
||||
|
||||
sinon.spy(clipboardHelperMock, "copyString");
|
||||
component.onCopyTabLocation("uri");
|
||||
|
|
Загрузка…
Ссылка в новой задаче