lift / lift/framework

addPostPageJavaScript added twice to a page

Open
#1,423 5 comments 0 reactions 2 assignees View on GitHub

@Shadowfiend is already working on this.

Since Jul 18, 2017.

Dominant language
Scala
Stars
1.3k
Forks
275
PR merge metrics
No merged PRs in 30d

Description

As discussed with David

Sample app here:
https://github.com/fmpwizard/lift_starter_2.4/tree/comet-fixedRender-issue

git clone git@github.com:fmpwizard/lift_starter_2.4.git
cd lift_starter_2.4
git checkout comet-fixedRender-issue
sbt

(note the branch name comet-fixedRender-issue )

Calling addPostPageJavaScript from fixedRender like this:

  override def fixedRender: Box[NodeSeq] = {
     S.session map { sess =>
      sess.addPostPageJavaScript( () => JsCmds.Alert("hi") )
    }
    logger.info("called fixed render")
    NodeSeq.Empty
  }

results in the html having the alert("hi") twice.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.