Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Context menu search respects session setting of current tab #3895

Merged
merged 1 commit into from
Sep 12, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions js/contextMenus.js
Original file line number Diff line number Diff line change
Expand Up @@ -745,8 +745,12 @@ const searchSelectionMenuItem = (location) => {
label: locale.translation('openSearch').replace(/{{\s*selectedVariable\s*}}/, searchText),
click: (item, focusedWindow) => {
if (focusedWindow && location) {
let activeFrame = windowStore.getState().get('activeFrameKey')
let frame = windowStore.getFrame(activeFrame)
let searchUrl = windowStore.getState().getIn(['searchDetail', 'searchURL']).replace('{searchTerms}', encodeURIComponent(location))
windowActions.newFrame({ location: searchUrl }, true)
windowActions.newFrame({ location: searchUrl,
isPrivate: frame.get('isPrivate'),
partitionNumber: frame.get('partitionNumber') }, true)
}
}
}
Expand Down Expand Up @@ -844,10 +848,14 @@ function mainTemplateInit (nodeProps, frame) {
{
label: locale.translation('searchImage'),
click: (item) => {
let activeFrame = windowStore.getState().get('activeFrameKey')
let frame = windowStore.getFrame(activeFrame)
let searchUrl = windowStore.getState().getIn(['searchDetail', 'searchURL'])
.replace('{searchTerms}', encodeURIComponent(nodeProps.srcURL))
.replace('?q', 'byimage?image_url')
windowActions.newFrame({ location: searchUrl }, true)
windowActions.newFrame({ location: searchUrl,
isPrivate: frame.get('isPrivate'),
partitionNumber: frame.get('partitionNumber')}, true)
}
}
)
Expand Down