From 4181048938944fb940cc1d88d218ad617c8be48c Mon Sep 17 00:00:00 2001 From: Yura Trambitskiy Date: Thu, 19 Mar 2015 19:33:03 +0300 Subject: [PATCH] added js setting of dialog width. it allows to close the dialog by clicking on overlay in this http://screencast.com/t/jdCEuPPlD88 areas, which earlier didn't work. I think it was a bug --- dialog.css | 5 +++-- index.js | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dialog.css b/dialog.css index 30cb212..83be4d9 100644 --- a/dialog.css +++ b/dialog.css @@ -1,8 +1,9 @@ .dialog { position: fixed; top: 150px; - left: 5%; - width: 90%; + left: 0; + right: 0; + margin: auto; z-index: 1000; text-align: center; } diff --git a/index.js b/index.js index 3a6448b..3ec511c 100644 --- a/index.js +++ b/index.js @@ -248,6 +248,7 @@ Dialog.prototype.show = function(){ // position document.body.appendChild(this.el); this._classes.remove('hide'); + this.el.style.width = query('.content', this.el).offsetWidth+"px"; this.emit('show'); return this; };