cabrillo.modal :クライアント
Cabrillo JS ネイティブモーダル内に Web コンテンツを表示するための関数。
cabrillo.modal - dismissModal(オブジェクトデータ)
presentModal() 関数で提示されたモーダルを却下するために使用します。
提示されたモーダルは、それ自体を却下し、結果を提示するコンテキストに返します。dismissModal() 関数は、提示するコンテキストからではなく、提示されたコンテキストから呼び出す必要があります。
| 名前 | タイプ | 説明 |
|---|---|---|
| データ | オブジェクト | オプション。提示されたコンテキストがそれ自体を閉じたときに、提示コンテキストに戻すオブジェクト。 |
| タイプ | 説明 |
|---|---|
| 約束 | 成功した場合は未解決のオブジェクト、それ以外の場合はエラー。 |
// Any object can be passed back to the presenting context when the presented context dismisses itself.
var results = {
team: 'Mobile'
company: 'ServiceNow'
}
cabrillo.modal.dismissModal(results).then(function() {
console.log('Modal was dismissed and results were passed to presenting context.');
}, function(error) {
console.log(error);
});
cabrillo.modal - presentModal( 文字列 title, 文字列 url, 文字列 closeButtonStyle, 文字列 modalPresentationStyle)
ネイティブのモーダルインターフェイスでコンテンツを表示します。
| 名前 | タイプ | 説明 |
|---|---|---|
| title | 文字列 | モーダルインターフェイスのタイトル。 |
| URL | 文字列 | モーダルを開くための URL。これは内部インスタンス URL である必要があります (完全修飾または相対 URL が優先されます)。 |
| 閉じるボタンスタイル | 文字列 | モーダルインターフェイスの [閉じる] ボタンのスタイル。 可能な値:
|
| モーダルプレゼンテーションスタイル | 文字列 | モーダルインターフェイスのプレゼンテーションスタイル。 可能な値:
注: このパラメーターは Apple iOS でのみサポートされています。 |
| タイプ | 説明 |
|---|---|
| 約束 | 成功した場合は Cabrillo.ModalResponse オブジェクト、それ以外の場合はエラー。 |
カスタム URL をロードするネイティブモーダルを表示します。これにより、カスタムサービスポータルページがフォームシートスタイルのモーダルで表示されます。モーダルが却下されると、約束は履行されます。カスタム却下機能については、 dismissModal() 関数を参照してください。
cabrillo.modal.presentModal('Portal Page',
'/$sp.do?id=my_modal_page',
cabrillo.modal.CLOSE_BUTTON_STYLE_CLOSE,
cabrillo.modal.MODAL_PRESENTATION_STYLE_FORM_SHEET
).then(function(response) {
// The results from the modal are in a results key on the response object.
var results = response && response.results ? response.results : null;
if (results) {
console.log('Modal dismissed with results.', results);
} else {
console.log('Modal dismissed without results.');
}
}, function(error) {
console.log(error);
});