From 2a5402152403d9c4bc63a8808bfcadce37678595 Mon Sep 17 00:00:00 2001 From: RubaXa Date: Tue, 22 Jul 2014 21:04:38 +0400 Subject: [PATCH] #5: ui --- README.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b84354e..38a17e3 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,19 @@ Include [ply.css](ply.css) in `` (optional) Create a dialog: ```js Ply.dialog("alert", "Wow!").then(function (ui) { - ui.by; // submit, overlay, esc, "x" 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]" } }).then(function (ui) { - // ... + if (ui.state) { + // OK + } else { + // Cancel + // ui.by — 'overlay', 'x', 'esc' + } }) ```