Skip to content

Latest commit

 

History

History
153 lines (132 loc) · 6.62 KB

API.md

File metadata and controls

153 lines (132 loc) · 6.62 KB

ax5dialog

Kind: global class
Author: tom@axisj.com

ax5dialog.setConfig(config) ⇒ ax5dialog

Preferences of dialog UI

Kind: static method of ax5dialog

Param Type Default Description
config Object 클래스 속성값
[config.theme] String "default"
[config.width] Number 300
[config.title] String ""
[config.zIndex] Number
[config.onStateChanged] function onStateChanged function can be defined in setConfig method or new ax5.ui.dialog initialization method. However, you can us to define an event function after initialization, if necessary
[config.lang] Object
[config.lang.ok] String "ok"
[config.lang.cancel] String "cancel"
[config.animateTime] Number 150
[config.autoCloseTime] Number 0 0보다 크면 autoCloseTime 프레임후에 dialog auto close

Example

var dialog = new ax5.ui.dialog();
dialog.setConfig({
     title: "app dialog title",
     zIndex: 5000,
     onStateChanged: function () {
         if (this.state === "open") {
             mask.open();
         }
         else if (this.state === "close") {
             mask.close();
         }
     }
});

ax5dialog.alert(config, [callback]) ⇒ ax5dialog

open the dialog of alert type

Kind: static method of ax5dialog

Param Type Default Description
config Object | String dialog 속성을 json으로 정의하거나 msg만 전달
[config.theme] String "default"
[config.width] Number 300
[config.title] String ""
[config.zIndex] Number
[config.onStateChanged] function
[config.lang] Object
[config.lang.ok] String "ok"
[config.lang.cancel] String "cancel"
[config.animateTime] Number 150
[config.autoCloseTime] Number 0 0보다 크면 autoCloseTime 프레임후에 dialog auto close
[config.additionalContent] function | String
[callback] function 사용자 확인 이벤트시 호출될 callback 함수

Example

myDialog.alert({
 title: 'app title',
 msg: 'alert'
}, function(){});

ax5dialog.confirm(config, [callback]) ⇒ ax5dialog

open the dialog of confirm type

Kind: static method of ax5dialog

Param Type Default Description
config Object | String dialog 속성을 json으로 정의하거나 msg만 전달
[config.theme] String "default"
[config.width] Number 300
[config.title] String ""
[config.zIndex] Number
[config.onStateChanged] function
[config.lang] Object
[config.lang.ok] String "ok"
[config.lang.cancel] String "cancel"
[config.animateTime] Number 150
[config.autoCloseTime] Number 0 0보다 크면 autoCloseTime 프레임후에 dialog auto close
[config.additionalContent] function | String
[callback] function 사용자 확인 이벤트시 호출될 callback 함수

Example

myDialog.confirm({
     title: 'app title',
     msg: 'confirm',
     additionalContent: function () {
         return "<div style='border:1px solid #ccc;border-radius: 5px;background: #eee;padding: 10px;'>추가정보</div>";
     }
}, function(){});

ax5dialog.prompt(config, [callback]) ⇒ ax5dialog

open the dialog of prompt type

Kind: static method of ax5dialog

Param Type Default Description
config Object | String dialog 속성을 json으로 정의하거나 msg만 전달
[config.theme] String "default"
[config.width] Number 300
[config.title] String ""
[config.zIndex] Number
[config.onStateChanged] function
[config.lang] Object
[config.lang.ok] String "ok"
[config.lang.cancel] String "cancel"
[config.animateTime] Number 150
[config.autoCloseTime] Number 0 0보다 크면 autoCloseTime 프레임후에 dialog auto close
[config.additionalContent] function | String
[callback] function 사용자 확인 이벤트시 호출될 callback 함수

Example

myDialog.prompt({
 title: 'app title',
 msg: 'alert'
}, function(){});

ax5dialog.close() ⇒ ax5dialog

close the dialog

Kind: static method of ax5dialog
Example

myDialog.close();