From a7d3eb8e7d7d4a28f8b742774cd621893498ffb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=CC=81scar=20Sola=CC=81s?= Date: Fri, 2 Jun 2017 10:25:51 +0200 Subject: [PATCH] Updated readme and added "open()" Method --- README.md | 14 ++++++++++++++ paper-lightbox.html | 2 +- source/paper-lightbox.coffee | 13 +++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e4edfff..2d14e98 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,19 @@ +[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg?style=flat-square)](https://beta.webcomponents.org/element/oscarsolas/paper-lightbox) + # Paper-lightbox ### Description Polymer element for launch a popup with a image, iframe, inline or ajax content. +### Install + +First you need bower, [see their site](http://bower.io/) for details + +```sh +bower install --save oscarsolas/paper-lightbox +``` + ### Examples A simple example of its use: @@ -30,6 +40,10 @@ A simple example of its use: launch iframe popup + +
+
inline content example
+
``` ### Attributes diff --git a/paper-lightbox.html b/paper-lightbox.html index ef0a774..4f49dd8 100644 --- a/paper-lightbox.html +++ b/paper-lightbox.html @@ -13,5 +13,5 @@ - + \ No newline at end of file diff --git a/source/paper-lightbox.coffee b/source/paper-lightbox.coffee index 8938b2d..6ecc294 100644 --- a/source/paper-lightbox.coffee +++ b/source/paper-lightbox.coffee @@ -212,3 +212,16 @@ Polymer onAjaxContentLoaded: -> onImageLoaded: -> + + open: -> + module = @ + + switch @_getType() + when 'ajax' + @_createAjax() + when 'image' + @_createImage() + when 'inline' + @_createInline() + when 'iframe' + @_createIframe()