Skip to content

Commit ac6a267

Browse files
authored
Merge pull request #935 from crazyserver/MOBILE-1987
MOBILE-1987 completion: Solve completion updating
2 parents 59f8e58 + 773d867 commit ac6a267

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

www/addons/mod/chat/templates/chat.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<button ng-if="loaded" class="button button-icon icon ion-person-stalker" ng-click="showChatUsers()"></button>
66
</ion-nav-buttons>
77

8-
<ion-content class="padding" delegate-handle="mmaChatScroll" mm-state-class>
8+
<ion-content delegate-handle="mmaChatScroll" mm-state-class>
99
<mm-loading hide-until="loaded">
1010
<section class="mma-chat-discussion-container" aria-live="polite">
1111
<div class="list">

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@ angular.module('mm.core.course')
2828
*
2929
* @example
3030
*
31-
* <mm-course-module module="module"></mm-course-module>
31+
* <mm-course-module module="module" completion-changed="completionChanged"></mm-course-module>
3232
*/
3333
.directive('mmCourseModule', function() {
3434
return {
3535
restrict: 'E',
3636
scope: {
3737
module: '=',
38+
completionChanged: '=?'
3839
},
3940
templateUrl: 'core/components/course/templates/module.html'
4041
};

www/core/components/course/templates/section.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ <h2><mm-format-text watch="true">{{ section.name }}</mm-format-text></h2>
2222
<mm-format-text>{{ section.summary }}</mm-format-text>
2323
</div>
2424

25-
<mm-course-module class="item item-complex" ng-repeat="module in section.modules" module="module"></mm-course-module>
25+
<mm-course-module class="item item-complex" ng-repeat="module in section.modules" module="module" completion-changed="completionChanged"></mm-course-module>
2626

2727
<!-- When there is nothing in the section. -->
2828
<div class="item item-text-wrap" ng-if="section.modules.length < 1 && sections.length == 1">

www/core/directives/completion.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,7 @@ angular.module('mm.core')
102102
scope.afterChange();
103103
}
104104
}).catch(function(error) {
105-
if (error) {
106-
$mmUtil.showErrorModal(error);
107-
} else {
108-
$mmUtil.showErrorModal('mm.core.errorchangecompletion', true);
109-
}
105+
$mmUtil.showErrorModalDefault(error, 'mm.core.errorchangecompletion', true);
110106
}).finally(function() {
111107
modal.dismiss();
112108
});

0 commit comments

Comments
 (0)