diff options
Diffstat (limited to 'src/main/scala/reading/component/widget/Popup.scala')
-rw-r--r-- | src/main/scala/reading/component/widget/Popup.scala | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/main/scala/reading/component/widget/Popup.scala b/src/main/scala/reading/component/widget/Popup.scala deleted file mode 100644 index 86b47bf..0000000 --- a/src/main/scala/reading/component/widget/Popup.scala +++ /dev/null @@ -1,44 +0,0 @@ -package reading.component.widget - -import org.scalajs.dom - -import rx._ -import Ctx.Owner.Unsafe._ - -import scalatags.JsDom.all._ -import scalacss.Defaults._ -import scalacss.ScalatagsCss._ - -import reading.component.widget.style.{ Popup => PopupStyle } -import reading.utils.{ RxAttr } - -object Popup { - def apply(onClose: => Unit)(content: HtmlTag): HtmlTag = { - dom.document.body.style.overflowY = "hidden" - - div( - PopupStyle.render, - PopupStyle.popup, - - div( - PopupStyle.curtain, - RxAttr(onclick, Rx(() => close(onClose))) - ), - - div( - PopupStyle.content, - content, - button( - PopupStyle.close, - RxAttr(onclick, Rx(() => close(onClose))), - "Fermer" - ) - ) - ) - } - - private def close(onClose: => Unit): Unit = { - dom.document.body.style.overflowY = "scroll" - onClose - } -} |