cabrillo.modal - 클라이언트
카브리요 JS 네이티브 모달 내부에 웹 컨텐츠를 표시하는 기능입니다.
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(문자열 제목, 문자열 URL, 문자열 closeButtonStyle, 문자열 modalPresentationStyle)
네이티브 모달 인터페이스에 컨텐츠를 표시합니다.
| 이름 | 유형 | 설명 |
|---|---|---|
| 제목 | 문자열 | 모달 인터페이스의 제목입니다. |
| URL | 문자열 | 모달을 여는 URL입니다. 이 URL은 내부 인스턴스 URL이어야 합니다(정규화된 URL이거나 상대적인 URL, 상대 URL이 선호됨). |
| closeButtonStyle (영문) | 문자열 | 모달 인터페이스의 닫기 버튼 스타일입니다. 가능한 값:
|
| modalPresentationStyle (모달프리젠테이션 스타일) | 문자열 | 모달 인터페이스의 프레젠테이션 스타일입니다. 가능한 값:
주: 이 매개변수는 에서만 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);
});