Skip to content

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
ajile committed Aug 8, 2016
1 parent e78716e commit b0cbd9d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# ember-dialog [![license](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](https://github.com/wheely/ember-dialog/blob/master/LICENSE.md) [![Build Status](https://travis-ci.org/wheely/ember-dialog.svg?branch=master)](https://travis-ci.org/wheely/ember-dialog) [![Code Climate](https://codeclimate.com/github/wheely/ember-dialog/badges/gpa.svg)](https://codeclimate.com/github/wheely/ember-dialog) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/f364ecdab2f4486dbd15b198d5debf87)](https://www.codacy.com/app/ajile/ember-dialog?utm_source=github.com&utm_medium=referral&utm_content=wheely/ember-dialog&utm_campaign=Badge_Grade)

Old version (ember-cli-dialog and ember-dialog below v2) outdated and will not be supported.
A lightweight and powerful Ember Addon that allows you to easily create <b>routable</b> dialog windows and control their closing. It consists of a service that is available from any object and a component which is a dialog-window itself.

See <a href="http://wheely.github.io/ember-dialog/#/tutorial/creating">Tutorials</a> (with examples), <a href="http://wheely.github.io/ember-dialog/#/cookbook/animation">Cookbook</a> and <a href="http://wheely.github.io/ember-dialog/docs/">Documentation</a>.
With ember-dialog you can create any popups like dialogs, modals, notices, bubbles etc. We have decided do not include realization of all this features to the library for minification reasons. Instead of it we have written absolute documentation how you can make it your own (see <a href="http://wheely.github.io/ember-dialog/#/cookbook">cookbook</a> and <a href="http://wheely.github.io/ember-dialog/#/tutorial">tutorial</a> with examples). You can look the library's code on github and get surprised how much code on aboard to realize all features, presented on this site.

## Installation

Expand All @@ -16,8 +16,6 @@ ember install ember-dialog

<img align="right" src="http://dl2.joxi.net/drive/2016/07/14/0007/2363/473403/03/5f20c42c19.png">

A lightweight and powerful Ember Addon that allows you to easily create *routable* dialog windows and control their closing. It consists of a service that is available from any object and a component which is a dialog-window itself.

The principle of work is simple. Service is instructed to display a modal window (`show`, `alert`, `confirm` or `blank` methods), creates a component instance with required layout and template, then renders it, and attaches it to the body. At this point, it also creates a Promise, "handles" of which puts into the component and returns it. The component has 2 actions on aboard: one for `resolved` closing, another one for `rejected` closing. Actions available within the template and can be called, for instance by clicking on the button (in the layout or in the template). When you call an action, one of the Promise's method is executed and triggered independent "accepted" or "declined" event. The dialog service when gets the event destroys component object and detaches it from the DOM.

Let's say you want to ask user confirm an action. You should call `show` method of the dialog service with a layout path (you needed dialog window with two buttons - `confirm` layout what you need) and a path to template that you want to show the user in the modal window. Method creates and shows dialog window and returns a Promise, that will become resolved or rejected when window closed (it's depend on which button user has clicked).
Expand Down
2 changes: 2 additions & 0 deletions tests/dummy/app/templates/getting-started/partials/en.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

<p>So how do they look like? See yourself: <a class="w-link w-link__pseudo" onclick={{action "showAlert"}}>alert</a>, <a class="w-link w-link__pseudo" onclick={{action "showConfirm"}}>confirm</a> and <a class="w-link w-link__pseudo" onclick={{action "showBlank"}}>blank</a>.</p>

<p>With ember-dialog you can create any popups like dialogs, modals, notices, bubbles etc. We have decided do not include realization of all this features to the library for minification reasons. Instead of it we have written absolute documentation how you can make it your own (see {{#link-to 'cookbook'}}{{t "navigation.cookbook"}}{{/link-to}} and {{#link-to 'tutorial'}}{{t "navigation.tutorial"}}{{/link-to}}). You can look the library's code on github and get surprised how much code on aboard to realize all features, presented on this site.</p>

<h2 class="w-subtitle">Installation</h2>

<p>Installing the library is as easy as:</p>
Expand Down
2 changes: 2 additions & 0 deletions tests/dummy/app/templates/getting-started/partials/ru.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

<p>Сразу к делу, как они выглядят? Можете сами взглянуть: <a class="w-link w-link__pseudo" onclick={{action "showAlert"}}>alert</a>, <a class="w-link w-link__pseudo" onclick={{action "showConfirm"}}>confirm</a> и <a class="w-link w-link__pseudo" onclick={{action "showBlank"}}>blank</a>.</p>

<p>С помощью ember-dialog вы можете создавать любые всплавающие интерфейсы: диалоговые окна, модалки, предупреждения, баблы и т.п. Для минимизации кода библиотеки мы не стали включать их реализацию в проект, но постарались максимально подробно описать как это сделать в вашем проекте (см. разделы {{#link-to 'cookbook'}}{{t "navigation.cookbook"}}{{/link-to}} и {{#link-to 'tutorial'}}{{t "navigation.tutorial"}}{{/link-to}}). Также вы можете заглянуть в код библиотеки, вы будете приятно удивлены тем, каким количеством кода обеспечены описанные на этом сайте возможности.</p>

<h2 class="w-subtitle">Установка</h2>

<p>Установка аддона такая же простая как:</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default DialogManager.extend({
notice(template, context, options) {

const layout = "cookbook/creating-notices/partials/notice";
options = Ember.merge({ root: ".notices", delay: 2000 }, options);
options = Ember.merge({ root: ".notices", delay: 500 }, options);

this.one("created", presenter => {
Ember.run.later(presenter, "accept", options.delay)
Expand Down

0 comments on commit b0cbd9d

Please sign in to comment.