Skip to content

Commit f33c1c9

Browse files
committed
Merge pull request #287 from dpalou/MOBILE-1275
Mobile 1275
2 parents b449981 + c125401 commit f33c1c9

File tree

12 files changed

+156
-50
lines changed

12 files changed

+156
-50
lines changed

www/addons/mod_forum/templates/discussions.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ <h2><summary>{{discussion.subject}}</summary></h2>
2626
<p>{{discussion.userfullname}}</p>
2727
</div>
2828
<div class="item item-body">
29-
<p><mm-format-text watch="true" clean="true" shorten="150">{{discussion.message}}</mm-format-text></p>
29+
<p><mm-format-text watch="true" clean="true" shorten>{{discussion.message}}</mm-format-text></p>
3030
<span class="item-note text-right">
3131
<span ng-if="discussion.groupname">
3232
<i class="icon ion-ios-people"></i> {{ discussion.groupname }}

www/addons/mod_imscp/directives/bar.js

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ angular.module('mm.addons.mod_imscp')
2828
* @param {String} next ID of the next item.
2929
* @param {Function} action Function to call when an arrow is clicked. Will receive as a param the itemId to load.
3030
*/
31-
.directive('mmaModImscpBar', function($ionicModal) {
31+
.directive('mmaModImscpBar', function($state, $translate) {
3232
return {
3333
restrict: 'E',
3434
scope: {
@@ -39,20 +39,12 @@ angular.module('mm.addons.mod_imscp')
3939
},
4040
templateUrl: 'addons/mod_imscp/templates/bar.html',
4141
link: function(scope) {
42-
$ionicModal.fromTemplateUrl('addons/mod_imscp/templates/description.html', {
43-
scope: scope,
44-
animation: 'slide-in-up'
45-
}).then(function(modal) {
46-
scope.showDescription = function() {
47-
modal.show();
48-
};
49-
scope.closeDescription = function() {
50-
modal.hide();
51-
};
52-
scope.$on('$destroy', function() {
53-
modal.remove();
42+
scope.showDescription = function() {
43+
$state.go('site.mm_textviewer', {
44+
title: $translate.instant('mm.core.description'),
45+
content: scope.description
5446
});
55-
});
47+
};
5648
}
5749
};
5850
});

www/addons/mod_imscp/templates/description.html

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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">{{ description }}</mm-format-text>
3+
<mm-format-text class="mm-content-with-float" shorten fullview-on-click="true">{{ description }}</mm-format-text>
44
<p ng-if="note"><span class="item-note">{{ note }}</span></p>
55
</div>
66
</div>

www/core/components/courses/templates/list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ <h2><mm-format-text watch="true">{{course.fullname}}</mm-format-text></h2>
2020
<div class="item item-text-wrap" ng-show="course.summary">
2121
<p>
2222
<summary>
23-
<mm-format-text class="mm-content-with-float" watch="true" shorten="150" expand-on-click="true">{{course.summary}}</mm-format-text>
23+
<mm-format-text class="mm-content-with-float" watch="true" shorten="40%" expand-on-click="true">{{course.summary}}</mm-format-text>
2424
</summary>
2525
</p>
2626
</div>

www/core/components/courses/templates/search.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ <h2><mm-format-text watch="true">{{course.fullname}}</mm-format-text></h2>
2121
<div class="item item-text-wrap" ng-if="course.summary">
2222
<p>
2323
<summary>
24-
<mm-format-text class="mm-content-with-float" watch="true" shorten="150" expand-on-click="true">{{course.summary}}</mm-format-text>
24+
<mm-format-text class="mm-content-with-float" watch="true" shorten="40%" expand-on-click="true">{{course.summary}}</mm-format-text>
2525
</summary>
2626
</p>
2727
</div>

www/core/components/courses/templates/viewresult.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ <h2><mm-format-text watch="true">{{course.fullname}}</mm-format-text></h2>
1818
<div class="item item-text-wrap" ng-if="course.summary">
1919
<p>
2020
<summary>
21-
<mm-format-text class="mm-content-with-float" watch="true" shorten="150" expand-on-click="true">{{course.summary}}</mm-format-text>
21+
<mm-format-text class="mm-content-with-float" watch="true" shorten="40%" expand-on-click="true">{{course.summary}}</mm-format-text>
2222
</summary>
2323
</p>
2424
</div>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// (C) Copyright 2015 Martin Dougiamas
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
angular.module('mm.core.textviewer')
16+
17+
/**
18+
* Text viewer controller.
19+
*
20+
* @module mm.core.textviewer
21+
* @ngdoc controller
22+
* @name mmTextViewerIndexCtrl
23+
*/
24+
.controller('mmTextViewerIndexCtrl', function($stateParams, $scope) {
25+
$scope.title = $stateParams.title;
26+
$scope.content = $stateParams.content;
27+
});
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// (C) Copyright 2015 Martin Dougiamas
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
angular.module('mm.core.textviewer', [])
16+
17+
.config(function($stateProvider) {
18+
19+
$stateProvider
20+
21+
.state('site.mm_textviewer', {
22+
url: '/mm_textviewer',
23+
params: {
24+
title: null,
25+
content: null
26+
},
27+
views: {
28+
'site': {
29+
templateUrl: 'core/components/textviewer/templates/textviewer.html',
30+
controller: 'mmTextViewerIndexCtrl'
31+
}
32+
}
33+
});
34+
35+
});
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<ion-view>
2+
<ion-nav-title>{{ title }}</ion-nav-title>
3+
<ion-content class="padding">
4+
<mm-format-text class="mm-content-with-float">{{ content }}</mm-format-text>
5+
</ion-content>
6+
</ion-view>

0 commit comments

Comments
 (0)