Skip to content

Commit

Permalink
Fix dialog button on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
fttx committed May 30, 2020
1 parent 61c168b commit 9cc5f9b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
8 changes: 4 additions & 4 deletions last-ionic-info.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ Cordova:

Cordova CLI : 9.0.0 ([email protected])
Cordova Platforms : android 8.1.0, ios 5.1.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.2.0, (and 20 other plugins)
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.2.0, (and 22 other plugins)

Utility:

cordova-res : 0.8.1 (update available: 0.12.2)
cordova-res : 0.8.1 (update available: 0.14.0)
native-run : 0.2.8 (update available: 1.0.0)

System:
Expand All @@ -22,7 +22,7 @@ System:
ios-deploy : 1.9.4
ios-sim : 8.0.2
NodeJS : v10.16.2 (/usr/local/bin/node)
npm : 6.10.3
npm : 6.14.4
OS : macOS Catalina
Xcode : Xcode 11.4.1 Build version 11E503a
Xcode : Xcode 11.5 Build version 11E608c

8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, ViewChild } from '@angular/core';
import { AlertController, Content, NavParams, ViewController } from 'ionic-angular';
import { AlertController, Content, NavParams, ViewController, Platform } from 'ionic-angular';
import * as Supplant from 'supplant';
import { OutputProfileModel } from '../../../models/output-profile.model';
import { Settings } from './../../../providers/settings';
Expand Down Expand Up @@ -30,6 +30,7 @@ export class SelectScanningModePage {
private settings: Settings,
private scanSessionsStorage: ScanSessionsStorage,
public navParams: NavParams,
private platform: Platform,
// public ngZone: NgZone,
) {
this.scanSession = navParams.get('scanSession');
Expand Down Expand Up @@ -102,11 +103,11 @@ export class SelectScanningModePage {
title: 'Name', message: 'Insert a name for this scan session',
inputs: [{ name: 'name', placeholder: defaultName }],
buttons: [
{ text: 'Cancel', handler: () => { reject() }, cssClass: 'button-outline-md' },
{ text: 'Ok', handler: data => { }, cssClass: 'button-outline-md button-ok', }
{ text: 'Cancel', handler: () => { reject() }, cssClass: this.platform.is('android') ? 'button-outline-md' : null },
{ text: 'Ok', handler: data => { }, cssClass: this.platform.is('android') ? 'button-outline-md button-ok' : null, }
],
enableBackdropDismiss: false,
cssClass: 'alert-big-buttons',
cssClass: this.platform.is('android') ? 'alert-big-buttons' : null,
});

alert.onDidDismiss((data) => {
Expand Down
6 changes: 3 additions & 3 deletions src/providers/scan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -640,12 +640,12 @@ export class ScanProvider {
title: label,
message: showError ? errorMessage : null,
enableBackdropDismiss: false,
cssClass: 'alert-get-field alert-big-buttons',
cssClass: this.platform.is('android') ? 'alert-get-field alert-big-buttons' : null,
inputs: [{ name: 'value', type: fieldType, placeholder: placeholder }],
buttons: [{
role: 'cancel', text: 'Cancel',
handler: () => { reject('cancelled'); },
cssClass: 'button-outline-md',
cssClass: this.platform.is('android') ? 'button-outline-md' : null,
}, {
text: 'Ok',
handler: data => {
Expand All @@ -659,7 +659,7 @@ export class ScanProvider {
resolve(defaultValue || '');
}
},
cssClass: 'button-outline-md button-ok',
cssClass: this.platform.is('android') ? 'button-outline-md button-ok' : null,
}]
});
alert.setLeavingOpts({ keyboardClose: false, animate: false });
Expand Down
2 changes: 1 addition & 1 deletion src/theme/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ $colors: (
@import "noto-sans";


.md{
.md {
.button-ok {
color: white !important;
background-color: map-get($colors, primary) !important;
Expand Down

0 comments on commit 9cc5f9b

Please sign in to comment.