2018-02-14 10:29:12 +01:00
|
|
|
// (C) Copyright 2015 Martin Dougiamas
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
2018-02-15 14:57:18 +01:00
|
|
|
import { Component, ViewChild } from '@angular/core';
|
2018-02-14 10:29:12 +01:00
|
|
|
import { IonicPage, NavParams } from 'ionic-angular';
|
|
|
|
import { CoreDomUtilsProvider } from '../../../../providers/utils/dom';
|
|
|
|
import { CoreSiteAddonsProvider } from '../../providers/siteaddons';
|
2018-02-15 14:57:18 +01:00
|
|
|
import { CoreSiteAddonsAddonContentComponent } from '../../components/addon-content/addon-content';
|
2018-02-14 10:29:12 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Page to render a site addon page.
|
|
|
|
*/
|
|
|
|
@IonicPage({ segment: 'core-site-addons-addon-page' })
|
|
|
|
@Component({
|
|
|
|
selector: 'page-core-site-addons-addon',
|
|
|
|
templateUrl: 'addon-page.html',
|
|
|
|
})
|
|
|
|
export class CoreSiteAddonsAddonPage {
|
2018-02-15 14:57:18 +01:00
|
|
|
@ViewChild(CoreSiteAddonsAddonContentComponent) content: CoreSiteAddonsAddonContentComponent;
|
|
|
|
|
2018-02-14 10:29:12 +01:00
|
|
|
title: string; // Page title.
|
|
|
|
|
|
|
|
protected component: string;
|
|
|
|
protected method: string;
|
|
|
|
protected args: any;
|
|
|
|
|
|
|
|
constructor(params: NavParams, protected domUtils: CoreDomUtilsProvider, protected siteAddonsProvider: CoreSiteAddonsProvider) {
|
|
|
|
this.title = params.get('title');
|
|
|
|
this.component = params.get('component');
|
|
|
|
this.method = params.get('method');
|
|
|
|
this.args = params.get('args');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Refresh the data.
|
|
|
|
*
|
|
|
|
* @param {any} refresher Refresher.
|
|
|
|
*/
|
|
|
|
refreshData(refresher: any): void {
|
2018-02-15 14:57:18 +01:00
|
|
|
this.content.refreshData().finally(() => {
|
|
|
|
refresher.complete();
|
2018-02-14 10:29:12 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|