File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed
addons/mod_label/templates Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff 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 : {
Original file line number Diff line number Diff line change 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 >
You can’t perform that action at this time.
0 commit comments