Skip to content

Commit

Permalink
update to scalajs 1.0.0-M3
Browse files Browse the repository at this point in the history
  • Loading branch information
chandu0101 committed Feb 2, 2018
1 parent b625179 commit c7ef152
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 7 deletions.
10 changes: 5 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name := "web-router"

//version := "2017.12.0-SNAPSHOT"
//version := "2018.1.0-SNAPSHOT"

enablePlugins(ScalaJSPlugin)

Expand All @@ -21,8 +21,8 @@ scalacOptions ++= Seq(
//deps

libraryDependencies ++= Seq(
"scalajs-react-interface" %%% "core" % "2017.12.28-RC" % Provided,
"scalajs-react-interface" %%% "universal" % "2017.12.28-RC" % Provided)
"scalajs-react-interface" %%% "core" % "2018.2.2-RC" % Provided,
"scalajs-react-interface" %%% "universal" % "2018.2.2-RC" % Provided)

//bintray
resolvers += Resolver.jcenterRepo
Expand Down Expand Up @@ -75,8 +75,8 @@ resolvers ++=Seq(Resolver.bintrayRepo("scalajs-react-interface", "maven"),

libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "0.9.4" % Test,
"scalajs-jest" %%% "core" % "2017.12.27-RC" % Test,
"scalajs-react-interface" %%% "web" % "2017.12.28-RC" % Test
"scalajs-jest" %%% "core" % "2018.2.2-RC" % Test,
"scalajs-react-interface" %%% "web" % "2018.2.2-RC" % Test
)
//scalaJSStage in Global := FastOptStage
scalaJSStage in Global := FullOptStage
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sbt.version=1.0.4
sbt.version=1.1.0

2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.0.0-M2")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.0.0-M3")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "2.0.0")
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.2")
18 changes: 18 additions & 0 deletions src/main/scala/sri/web/router/RouterCtrl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,24 @@ final class RouterCtrl private[router] (val history: History,
}
}

/**
* use this method to navigate to static pages using screenKey
*/
def navigateWithKey(screenKey: RouterScreenKey,
action: NavigationAction = NavigationAction.PUSH,
search: js.UndefOr[String] = js.undefined,
) = {
config.staticRoutes.get(screenKey.toString) match {
case Some(route) => {
val location =
new Location(pathname = route.path, search = search)
if (action == NavigationAction.REPLACE) history.replace(location)
else history.push(location)
}
case None => handleNotFound()
}
}

def navigateBack() = history.goBack()

def navigateForward() = history.goForward()
Expand Down

0 comments on commit c7ef152

Please sign in to comment.