MOBILE-2430 core: Add fab-icons to add actions

main
Pau Ferrer Ocaña 2018-06-11 11:00:41 +02:00
parent 19269f36f9
commit d1076eb794
7 changed files with 29 additions and 10 deletions

View File

@ -3,7 +3,7 @@
<ion-title><core-format-text [text]="title"></core-format-text></ion-title>
</ion-navbar>
</ion-header>
<ion-content>
<ion-content [class.has-fab]="showUpload && root != 'site' && !path">
<ion-refresher [enabled]="filesLoaded && (showPrivateFiles || showSiteFiles)" (ionRefresh)="refreshData($event)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>

View File

@ -95,5 +95,10 @@
<a (click)="searchReset()">{{ 'addon.mod_data.resetsettings' | translate}}</a>
</core-empty-box>
</core-loading>
<ion-fab bottom right *ngIf="canAdd">
<button ion-fab (click)="gotoAddEntries($event)" [attr.aria-label]="'addon.mod_data.addentries' | translate">
<ion-icon name="add"></ion-icon>
</button>
</ion-fab>

View File

@ -12,7 +12,7 @@
<!-- Content. -->
<core-split-view>
<ion-content>
<ion-content [class.has-fab]="forum && forum.cancreatediscussions">
<ion-refresher [enabled]="loaded" (ionRefresh)="doRefresh($event)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
@ -25,11 +25,6 @@
</ion-card>
<ng-container *ngIf="forum && discussions.length > 0">
<div padding-horizontal margin-vertical *ngIf="forum.cancreatediscussions">
<button ion-button block (click)="openNewDiscussion()">
{{addDiscussionText}}
</button>
</div>
<ion-card *ngFor="let discussion of offlineDiscussions" (click)="openNewDiscussion(discussion.timecreated)" [class.addon-forum-discussion-selected]="discussion.timecreated == -selectedDiscussion">
<ion-item text-wrap>
<ion-avatar item-start core-user-link [userId]="discussion.userid" [courseId]="courseId">
@ -97,5 +92,11 @@
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll>
</core-loading>
<ion-fab bottom right *ngIf="forum && forum.cancreatediscussions">
<button ion-fab (click)="openNewDiscussion()" [attr.aria-label]="addDiscussionText">
<ion-icon name="add"></ion-icon>
</button>
</ion-fab>
</ion-content>
</core-split-view>

View File

@ -677,6 +677,16 @@ canvas[core-chart] {
}
}
.has-fab .scroll-content{
padding-bottom: 56px;
}
.scroll-content ion-fab {
position: fixed;
margin-bottom: 56px;
}
// For some reason, in iOS the pages don't inherit the background-color from ion-app, set it explicitly.
.ion-page {
background-color: $background-color;

View File

@ -19,6 +19,7 @@ core-empty-box {
display: table-cell;
text-align: center;
vertical-align: middle;
pointer-events: auto;
}
&.core-empty-box-inline {

View File

@ -1,6 +1,8 @@
<ion-card *ngIf="description">
<ion-item text-wrap>
<core-format-text [text]="description" [component]="component" [componentId]="componentId" [maxHeight]="showFull && showFull !== 'false' ? 0 : 120" fullOnClick="true"></core-format-text>
<ion-note *ngIf="note" item-end>{{ note }}</ion-note>
</ion-item>
<ion-item text-wrap *ngIf="note">
<ion-note item-end>{{ note }}</ion-note>
</ion-item>
</ion-card>

View File

@ -9,7 +9,7 @@
</ion-buttons>
</ion-navbar>
</ion-header>
<ion-content>
<ion-content class="has-fab">
<ion-list>
<ion-item (click)="login(site.id)" *ngFor="let site of sites; let idx = index">
<ion-avatar item-start>