62 lines
1.5 KiB
TypeScript
Raw Normal View History

/// <reference path="../../../typings/globals/jquery/index.d.ts" />
import { Component } from '@angular/core';
import { NavController, AlertController } from 'ionic-angular';
import { Storage } from '@ionic/storage';
2017-11-22 18:30:09 -06:00
import { ProfileService, SavedPage } from '../../services/profile-service';
@Component({
selector: 'settings',
2017-11-22 18:30:09 -06:00
templateUrl: 'settings.html',
})
export class SettingsPage
{
constructor(
public navCtrl: NavController
2017-11-22 18:30:09 -06:00
, private alertCtrl: AlertController
, public profileService: ProfileService
) {}
textSizeChanged()
{
2017-11-22 18:30:09 -06:00
this.profileService.textSizeChanged();
this.save();
}
save()
{
2017-11-22 18:30:09 -06:00
this.profileService.save()
}
reset()
{
2017-11-22 18:30:09 -06:00
this.profileService.reset()
}
removePage(page: SavedPage)
{
let alert = this.alertCtrl.create({
title: 'Confirm Delete',
message: 'Do you want to delete the ' + page.title + ' page?',
buttons: [
{
text: 'Cancel',
role: 'cancel',
handler: () =>
{
console.log('Cancel clicked');
}
},
{
text: 'Ok',
handler: () =>
{
2017-11-22 18:30:09 -06:00
this.profileService.removePage(page);
}
}
]
});
alert.present();
}
2017-11-22 18:30:09 -06:00
}