Merge lp:~osomon/webbrowser-app/empty-contextual-menu into lp:webbrowser-app

Proposed by Olivier Tilloy
Status: Merged
Merged at revision: 560
Proposed branch: lp:~osomon/webbrowser-app/empty-contextual-menu
Merge into: lp:webbrowser-app
Diff against target: 44 lines (+18/-5)
2 files modified
src/Ubuntu/Components/Extras/Browser/UbuntuWebView01.qml (+9/-3)
src/Ubuntu/Components/Extras/Browser/UbuntuWebView02.qml (+9/-2)
To merge this branch: bzr merge lp:~osomon/webbrowser-app/empty-contextual-menu
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+222174@code.launchpad.net

Commit message

Do not display an empty contextual menu.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Ubuntu/Components/Extras/Browser/UbuntuWebView01.qml'
2--- src/Ubuntu/Components/Extras/Browser/UbuntuWebView01.qml 2014-03-17 10:16:11 +0000
3+++ src/Ubuntu/Components/Extras/Browser/UbuntuWebView01.qml 2014-06-05 11:51:21 +0000
4@@ -115,9 +115,15 @@
5 contextualData.href = data.href
6 contextualData.title = data.title
7 }
8- contextualRectangle.position(data)
9- PopupUtils.open(contextualPopover, contextualRectangle)
10- return
11+ if (contextualActions != null) {
12+ for (var i = 0; i < contextualActions.actions.length; ++i) {
13+ if (contextualActions.actions[i].enabled) {
14+ contextualRectangle.position(data)
15+ PopupUtils.open(contextualPopover, contextualRectangle)
16+ return
17+ }
18+ }
19+ }
20 }
21 }
22 if ((data.event === 'longpress') || (data.event === 'selectionadjusted')) {
23
24=== modified file 'src/Ubuntu/Components/Extras/Browser/UbuntuWebView02.qml'
25--- src/Ubuntu/Components/Extras/Browser/UbuntuWebView02.qml 2014-05-05 20:47:07 +0000
26+++ src/Ubuntu/Components/Extras/Browser/UbuntuWebView02.qml 2014-06-05 11:51:21 +0000
27@@ -76,8 +76,15 @@
28 contextualData.href = msg.args.href
29 contextualData.title = msg.args.title
30 }
31- contextualRectangle.position(msg.args)
32- internal.currentContextualMenu = PopupUtils.open(contextualPopover, contextualRectangle)
33+ if (contextualActions != null) {
34+ for (var i = 0; i < contextualActions.actions.length; ++i) {
35+ if (contextualActions.actions[i].enabled) {
36+ contextualRectangle.position(msg.args)
37+ internal.currentContextualMenu = PopupUtils.open(contextualPopover, contextualRectangle)
38+ break
39+ }
40+ }
41+ }
42 } else if (internal.currentContextualMenu != null) {
43 PopupUtils.close(internal.currentContextualMenu)
44 }

Subscribers

People subscribed via source and target branches

to status/vote changes: