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

Commit

Permalink
Merge pull request #3895 from MKuenzi/master
Browse files Browse the repository at this point in the history
Context menu search respects session setting of current tab
  • Loading branch information
bbondy authored Sep 12, 2016
2 parents b8f54c8 + 9fc0a7a commit d6a8b6d
Showing 1 changed file with 10 additions and 2 deletions.
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

0 comments on commit d6a8b6d

Please sign in to comment.