Skip to content

Commit 127e88e

Browse files
authored
Merge pull request #1096 from crazyserver/MOBILE-2117
MOBILE-2117 data: Add moreurl action exception
2 parents 1a234be + 8a5f947 commit 127e88e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

www/addons/mod/data/services/helper.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,12 @@ angular.module('mm.addons.mod_data')
6565
angular.forEach(actions, function(enabled, action) {
6666
replace = new RegExp("##" + action + "##", 'g');
6767
if (enabled) {
68-
render = '<mma-mod-data-action action="' + action + '" entry="entries['+ entryId +']" database="data"></mma-mod-data-action>';
68+
if (action == "moreurl") {
69+
// Render more url directly because it can be part of an HTML attribute.
70+
render = $mmSite.getURL() + '/mod/data/view.php?d={{data.id}}&rid=' + entryId;
71+
} else {
72+
render = '<mma-mod-data-action action="' + action + '" entry="entries['+ entryId +']" database="data"></mma-mod-data-action>';
73+
}
6974
template = template.replace(replace, render);
7075
} else {
7176
template = template.replace(replace, "");

0 commit comments

Comments
 (0)