Skip to content

Commit e9f4f4e

Browse files
authored
Merge pull request #5757 from Countly/SER-1680
[SER-1680] Make dropdown item clickable, not only the text
2 parents 29f8960 + 45bc3d3 commit e9f4f4e

File tree

20 files changed

+61
-115
lines changed

20 files changed

+61
-115
lines changed

frontend/express/public/core/app-resolution/templates/app-resolution.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
>
66
<template v-slot:header-right>
77
<cly-more-options v-if="topDropdown" size="small">
8-
<el-dropdown-item :key="idx" v-for="(item, idx) in topDropdown">
9-
<!--<span :class="item.icon"></span>-->
10-
<a :href="item.value" class="bu-ml-1">{{item.label}}</a>
11-
</el-dropdown-item>
8+
<el-dropdown-item :key="idx" v-for="(item, idx) in topDropdown" :command="{url: item.value}">{{item.label}}</el-dropdown-item>
129
</cly-more-options>
1310
</template>
1411
</cly-header>

frontend/express/public/core/app-version/templates/app-version.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
>
66
<template v-slot:header-right>
77
<cly-more-options v-if="topDropdown" size="small">
8-
<el-dropdown-item :key="idx" v-for="(item, idx) in topDropdown">
9-
<!--<span :class="item.icon"></span>-->
10-
<a :href="item.value" class="bu-ml-1">{{item.label}}</a>
11-
</el-dropdown-item>
8+
<el-dropdown-item :key="idx" v-for="(item, idx) in topDropdown" :command="{url: item.value}">{{item.label}}</el-dropdown-item>
129
</cly-more-options>
1310
</template>
1411
</cly-header>

frontend/express/public/core/carrier/templates/carrier.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66
>
77
<template v-slot:header-right>
88
<cly-more-options v-if="topDropdown" size="small">
9-
<el-dropdown-item :key="idx" v-for="(item, idx) in topDropdown">
10-
<!--<span :class="item.icon"></span>-->
11-
<a :href="item.value" class="bu-ml-1">{{item.label}}</a>
12-
</el-dropdown-item>
9+
<el-dropdown-item :key="idx" v-for="(item, idx) in topDropdown" :command="{url: item.value}">{{item.label}}</el-dropdown-item>
1310
</cly-more-options>
1411
</template>
1512
</cly-header>

frontend/express/public/core/device-and-type/templates/devices-and-types.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
>
66
<template v-slot:header-right>
77
<cly-more-options v-if="topDropdown" size="small">
8-
<el-dropdown-item :key="idx" v-for="(item, idx) in topDropdown">
9-
<!--<span :class="item.icon"></span>-->
10-
<a :href="item.value" class="bu-ml-1">{{item.label}}</a>
11-
</el-dropdown-item>
8+
<el-dropdown-item :key="idx" v-for="(item, idx) in topDropdown" :command="{url: item.value}">{{item.label}}</el-dropdown-item>
129
</cly-more-options>
1310
</template>
1411
<template v-slot:header-tabs>

frontend/express/public/core/geo-countries/templates/countries.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
>
66
<template v-slot:header-right>
77
<cly-more-options v-if="topDropdown" size="small">
8-
<el-dropdown-item :key="idx" v-for="(item, idx) in topDropdown">
9-
<!--<span :class="item.icon"></span>-->
10-
<a :href="item.value" class="bu-ml-1">{{item.label}}</a>
11-
</el-dropdown-item>
8+
<el-dropdown-item :key="idx" v-for="(item, idx) in topDropdown" :command="{url: item.value}">{{item.label}}</el-dropdown-item>
129
</cly-more-options>
1310
</template>
1411
</cly-header>

frontend/express/public/core/platform/templates/platform.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
>
66
<template v-slot:header-right>
77
<cly-more-options v-if="topDropdown" size="small">
8-
<el-dropdown-item :key="idx" v-for="(item, idx) in topDropdown">
9-
<!--<span :class="item.icon"></span>-->
10-
<a :href="item.value" class="bu-ml-1">{{item.label}}</a>
11-
</el-dropdown-item>
8+
<el-dropdown-item :key="idx" v-for="(item, idx) in topDropdown" :command="{url: item.value}">{{item.label}}</el-dropdown-item>
129
</cly-more-options>
1310
</template>
1411
</cly-header>

frontend/express/public/core/user-analytics-overview/templates/overview.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ <h2> {{i18n('user-analytics.overview-title')}} </h2>
99
</template>
1010
<template v-slot:header-right>
1111
<cly-more-options v-if="topDropdown" size="small">
12-
<el-dropdown-item :key="idx" v-for="(item, idx) in topDropdown">
13-
<!--<span :class="item.icon"></span>-->
14-
<a :href="item.value" class="bu-ml-1">{{item.label}}</a>
15-
</el-dropdown-item>
12+
<el-dropdown-item :key="idx" v-for="(item, idx) in topDropdown" :command="{url: item.value}">{{item.label}}</el-dropdown-item>
1613
</cly-more-options>
1714
</template>
1815
</cly-header>

frontend/express/public/javascripts/countly/countly.helpers.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,12 @@
397397
if (options.isExternalLink) {
398398
window.open(options.url, '_blank', 'noopener,noreferrer');
399399
}
400+
else if (options.download) {
401+
var a = document.createElement('a');
402+
a.href = options.url;
403+
a.download = options.download;
404+
a.click();
405+
}
400406
else {
401407
app.backlinkUrl = options.from;
402408
app.backlinkTitle = options.title;

frontend/express/public/javascripts/countly/vue/components/dropdown.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* global jQuery, Vue, ELEMENT, CV */
1+
/* global jQuery, Vue, ELEMENT, CV, CountlyHelpers */
22

33
(function(countlyVue) {
44

@@ -612,7 +612,12 @@
612612
methods: {
613613
handleMenuItemClick: function(command, instance) {
614614
if (!this.disabled) {
615-
this.$emit('command', command, instance);
615+
if (command && command.url) {
616+
CountlyHelpers.goTo({url: command.url, download: !!command.download, isExternalLink: !!command.isExternalLink});
617+
}
618+
else {
619+
this.$emit('command', command, instance);
620+
}
616621
this.$refs.dropdown.handleClose();
617622
}
618623
},

plugins/browser/frontend/public/templates/browser.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
>
66
<template v-slot:header-right>
77
<cly-more-options v-if="topDropdown" size="small">
8-
<el-dropdown-item :key="idx" v-for="(item, idx) in topDropdown">
9-
<!--<span :class="item.icon"></span>-->
10-
<a :href="item.value" class="bu-ml-1">{{item.label}}</a>
11-
</el-dropdown-item>
8+
<el-dropdown-item :key="idx" v-for="(item, idx) in topDropdown" :command="{url: item.value}">{{item.label}}</el-dropdown-item>
129
</cly-more-options>
1310
</template>
1411
</cly-header>

0 commit comments

Comments
 (0)