Skip to content

Commit 696c232

Browse files
committed
Merge pull request #299 from dpalou/MOBILE-1330
MOBILE-1330 labels: Don't shorten description in labels
2 parents 09b232b + 6bca919 commit 696c232

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<ion-view>
22
<ion-nav-title>{{ 'mma.mod_label.label' | translate }}</ion-nav-title>
33
<ion-content>
4-
<mm-course-mod-description description="description"></mm-course-mod-description>
4+
<mm-course-mod-description description="description" showfull="true"></mm-course-mod-description>
55
</ion-content>
66
</ion-view>

www/core/components/course/directives/mod_description.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ angular.module('mm.core.course')
3131
* If the description is asynchronous you should set the attribute 'watch' to true.
3232
* This attribute is directly shared with mmFormatText which needs it.
3333
*
34+
* You can add a note at the right side of the description by using the 'note' attribute.
35+
*
36+
* Module descriptions are shortened by default, allowing the user to see the full description by clicking in it.
37+
* If you want the whole description to be shown you can use the 'showfull' attribute.
38+
*
3439
* @example
3540
*
3641
* <mm-course-mod-description description="myDescription"></mm-course-mod-description>
@@ -43,6 +48,10 @@ angular.module('mm.core.course')
4348
if (attrs.watch) {
4449
element.find('mm-format-text').attr('watch', attrs.watch);
4550
}
51+
52+
return function(scope) { // Link function.
53+
scope.showfull = !!attrs.showfull;
54+
};
4655
},
4756
restrict: 'E',
4857
scope: {
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<div class="card" ng-if="description">
22
<div class="item item-text-wrap item-body">
3-
<mm-format-text class="mm-content-with-float" shorten fullview-on-click="true">{{ description }}</mm-format-text>
3+
<mm-format-text ng-if="!showfull" class="mm-content-with-float" shorten fullview-on-click="true">{{ description }}</mm-format-text>
4+
<mm-format-text ng-if="showfull" class="mm-content-with-float">{{ description }}</mm-format-text>
45
<p ng-if="note"><span class="item-note">{{ note }}</span></p>
56
</div>
67
</div>

0 commit comments

Comments
 (0)