cabrillo.modal - クライアント
Cabrillo JS ネイティブモーダルの内部に Web コンテンツを表示するための関数
cabrillo.modal - dismissModal(オブジェクトデータ)
presentModal() 関数で提示されたモーダルを閉じるために使用します。
提示されたモーダルは、それ自体を閉じ、すべての結果を提示コンテキストに返す役割を担います。dismissModal() 関数は、提示コンテキストからではなく、提示されたコンテキストから呼び出す必要があります。
| 名前 | タイプ | 説明 |
|---|---|---|
| data | オブジェクト | オプション。提示されたコンテキストがそれ自体を却下するときに、提示コンテキストに戻すオブジェクト。 |
| タイプ | 説明 |
|---|---|
| promise | 成功した場合は未解決のオブジェクト、それ以外の場合はエラー。 |
// 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 が優先) である必要があります。 |
| closeButtonStyle | 文字列 | モーダルインターフェイスの [閉じる] ボタンのスタイル。 可能な値:
|
| modalPresentationStyle | 文字列 | モーダルインターフェイスのプレゼンテーションスタイル。 可能な値:
注: このパラメーターは Apple iOS でのみサポートされています。 |
| タイプ | 説明 |
|---|---|
| promise | 成功した場合は 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);
});