RubaXa 11 years ago
parent
commit
2a54021524
  1. 20
      README.md

20
README.md

@ -23,8 +23,19 @@ Include [ply.css](ply.css) in `<head/>` (optional)
Create a dialog: Create a dialog:
```js ```js
Ply.dialog("alert", "Wow!").then(function (ui) { Ply.dialog("alert", "Wow!").then(function (ui) {
ui.by; // submit, overlay, esc, "x"
ui.state; // true — "OK", false — "cancel" ui.state; // true — "OK", false — "cancel"
ui.by; // submit, overlay, esc, "x"
});
//or
Ply.dialog("confirm", "Do you like it?").then(function (ui) {
if (ui.state) {
// Clicked "OK"
}
else {
// Clicked "Cancel"
// details: `ui.by` — "cancel", "overlay", "esc", "x"
}
}); });
``` ```
@ -54,7 +65,12 @@ Ply.dialog({
backEffect: "3d-flip[-180,180]" backEffect: "3d-flip[-180,180]"
} }
}).then(function (ui) { }).then(function (ui) {
// ... if (ui.state) {
// OK
} else {
// Cancel
// ui.by — 'overlay', 'x', 'esc'
}
}) })
``` ```

Loading…
Cancel
Save