Skip to content

Commit

Permalink
Fix #4103: fix legacy date with unspecified language
Browse files Browse the repository at this point in the history
  • Loading branch information
avernet committed Jun 20, 2019
1 parent c2533e8 commit b0bd3b0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions xforms/js/src/main/scala/org/orbeon/xforms/Page.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ package org.orbeon.xforms

import org.orbeon.xforms.facade.Control
import org.scalajs.dom
import org.scalajs.dom.html
import org.scalajs.dom.raw.{Attr, MutationObserver, MutationRecord}
import org.scalajs.dom.raw.{MutationObserver, MutationRecord}
import org.scalajs.dom.{Element, html}

import scala.scalajs.js
import scala.scalajs.js.annotation.{JSExportAll, JSExportTopLevel}
Expand Down Expand Up @@ -47,13 +47,13 @@ object Page {

private def langElement: Option[dom.Element] = {

val langElements = Iterator(
() dom.document.documentElement,
() dom.document.querySelector(".orbeon-portlet-div[lang]")
val langElements: Iterator[() Option[Element]] = Iterator(
() Option(dom.document.documentElement),
() Option(dom.document.querySelector(".orbeon-portlet-div[lang]"))
)
langElements
.map(_.apply())
.find(_.hasAttribute(LangAttr))
.collectFirst { case Some(element) if element.hasAttribute(LangAttr) element }
}

// noinspection AccessorLikeMethodIsEmptyParen
Expand Down

0 comments on commit b0bd3b0

Please sign in to comment.