Skip to content

Commit 86e81e4

Browse files
committed
Merge pull request #460 from dpalou/MOBILE-1536
MOBILE-1536 delegates: Allow handlers to define a class
2 parents 1f7d4f0 + daaa276 commit 86e81e4

File tree

32 files changed

+41
-6
lines changed

32 files changed

+41
-6
lines changed

www/addons/calendar/services/handlers.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ angular.module('mm.addons.calendar')
6666
$scope.icon = 'ion-calendar';
6767
$scope.title = 'mma.calendar.calendarevents';
6868
$scope.state = 'site.calendar';
69+
$scope.class = 'mma-calendar-handler';
6970
};
7071
};
7172

www/addons/coursecompletion/services/handlers.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ angular.module('mm.addons.coursecompletion')
130130

131131
// Button title.
132132
$scope.title = 'mma.coursecompletion.viewcoursereport';
133+
$scope.class = 'mma-coursecompletion-user-handler';
133134

134135
$scope.action = function($event) {
135136
$event.preventDefault();
@@ -208,6 +209,7 @@ angular.module('mm.addons.coursecompletion')
208209
return function($scope, $state) {
209210
$scope.icon = 'ion-android-checkbox-outline';
210211
$scope.title = 'mma.coursecompletion.coursecompletion';
212+
$scope.class = 'mma-coursecompletion-mine-handler';
211213
$scope.action = function($event, course) {
212214
$event.preventDefault();
213215
$event.stopPropagation();

www/addons/files/services/handlers.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ angular.module('mm.addons.files')
6666
$scope.icon = 'ion-folder';
6767
$scope.title = 'mma.files.myfiles';
6868
$scope.state = 'site.files';
69+
$scope.class = 'mma-files-handler';
6970
};
7071
};
7172

www/addons/frontpage/services/handlers.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ angular.module('mm.addons.frontpage')
7272
$scope.icon = 'ion-home';
7373
$scope.title = 'mma.frontpage.sitehome';
7474
$scope.state = 'site.mm_course-section';
75+
$scope.class = 'mma-frontpage-handler';
7576
};
7677
};
7778

www/addons/grades/services/handlers.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ angular.module('mm.addons.grades')
107107
return function($scope, $state) {
108108
$scope.icon = 'ion-stats-bars';
109109
$scope.title = 'mma.grades.grades';
110+
$scope.class = 'mma-grades-mine-handler';
110111
$scope.action = function($event, course) {
111112
$event.preventDefault();
112113
$event.stopPropagation();
@@ -178,6 +179,7 @@ angular.module('mm.addons.grades')
178179
*/
179180
return function($scope) {
180181
$scope.title = 'mma.grades.viewgrades';
182+
$scope.class = 'mma-grades-user-handler';
181183

182184
$scope.action = function($event) {
183185
$event.preventDefault();

www/addons/messages/services/handlers.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ angular.module('mm.addons.messages')
6363
return $mmaMessages.isContact(user.id).then(function(isContact) {
6464
if (isContact) {
6565
$scope.title = 'mma.messages.removecontact';
66+
$scope.class = 'mma-messages-removecontact-handler';
6667
} else {
6768
$scope.title = 'mma.messages.addcontact';
69+
$scope.class = 'mma-messages-addcontact-handler';
6870
}
6971
}).catch(function() {
7072
// This fails for some reason, let's just hide the button.
@@ -145,8 +147,10 @@ angular.module('mm.addons.messages')
145147
return $mmaMessages.isBlocked(user.id).then(function(isBlocked) {
146148
if (isBlocked) {
147149
$scope.title = 'mma.messages.unblockcontact';
150+
$scope.class = 'mma-messages-unblockcontact-handler';
148151
} else {
149152
$scope.title = 'mma.messages.blockcontact';
153+
$scope.class = 'mma-messages-blockcontact-handler';
150154
}
151155
}).catch(function() {
152156
// This fails for some reason, let's just hide the button.
@@ -222,6 +226,7 @@ angular.module('mm.addons.messages')
222226
*/
223227
return function($scope) {
224228
$scope.title = 'mma.messages.sendmessage';
229+
$scope.class = 'mma-messages-sendmessage-handler';
225230
$scope.action = function($event) {
226231
$event.preventDefault();
227232
$event.stopPropagation();
@@ -274,6 +279,7 @@ angular.module('mm.addons.messages')
274279
$scope.icon = 'ion-chatbox';
275280
$scope.title = 'mma.messages.messages';
276281
$scope.state = 'site.messages';
282+
$scope.class = 'mma-messages-handler';
277283
};
278284
};
279285

www/addons/mod_assign/services/handlers.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ angular.module('mm.addons.mod_assign')
5555
return function($scope) {
5656
$scope.title = module.name;
5757
$scope.icon = $mmCourse.getModuleIconSrc('assign');
58+
$scope.class = 'mma-mod_assign-handler';
5859
$scope.action = function(e) {
5960
if (e) {
6061
e.preventDefault();

www/addons/mod_book/services/handlers.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ angular.module('mm.addons.mod_book')
8686

8787
$scope.title = module.name;
8888
$scope.icon = $mmCourse.getModuleIconSrc('book');
89+
$scope.class = 'mma-mod_book-handler';
8990
$scope.buttons = [downloadBtn, refreshBtn];
9091
$scope.spinner = true; // Show spinner while calculating status.
9192

www/addons/mod_chat/services/handlers.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ angular.module('mm.addons.mod_chat')
5454
return function($scope) {
5555
$scope.title = module.name;
5656
$scope.icon = $mmCourse.getModuleIconSrc('chat');
57+
$scope.class = 'mma-mod_chat-handler';
5758
$scope.action = function(e) {
5859
$state.go('site.mod_chat', {module: module, courseid: courseid});
5960
};

www/addons/mod_choice/services/handlers.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ angular.module('mm.addons.mod_choice')
5555
return function($scope) {
5656
$scope.title = module.name;
5757
$scope.icon = $mmCourse.getModuleIconSrc('choice');
58+
$scope.class = 'mma-mod_choice-handler';
5859
$scope.action = function(e) {
5960
$state.go('site.mod_choice', {module: module, courseid: courseid});
6061
};

0 commit comments

Comments
 (0)