Skip to content

Commit

Permalink
Merge pull request #275 from VinceMacBuche/bug_3764/reload_tech_libra…
Browse files Browse the repository at this point in the history
…ry_button_broken

Fixes #3764 : Reload technique library button is not broken anymore
  • Loading branch information
fanf committed Jul 18, 2013
2 parents 4c3fb46 + b19bde4 commit 93bff87
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ class TechniqueLibraryManagement extends DispatchSnippet with Loggable {
case "userLibrary" => { _ => userLibrary }
case "bottomPanel" => { _ => showBottomPanel }
case "userLibraryAction" => { _ => userLibraryAction }
case "reloadTechniqueLibrary" => reloadTechniqueLibrary
case "reloadTechniqueButton" => reloadTechniqueLibrary(false)
case "reloadTechniqueLibrary" => reloadTechniqueLibrary(true)
}


Expand Down Expand Up @@ -702,7 +703,7 @@ class TechniqueLibraryManagement extends DispatchSnippet with Loggable {
""")
}

private[this] def reloadTechniqueLibrary : IdMemoizeTransform = SHtml.idMemoize { outerXml =>
private[this] def reloadTechniqueLibrary(isTechniqueLibraryPage : Boolean) : IdMemoizeTransform = SHtml.idMemoize { outerXml =>
def process = {
updatePTLibService.update(ModificationId(uuidGen.newUuid), CurrentUser.getActor, Some("Technique library reloaded by user")) match {
case Full(x) =>
Expand All @@ -712,7 +713,13 @@ class TechniqueLibraryManagement extends DispatchSnippet with Loggable {
logger.debug(error.messageChain, e)
S.error("updateLib", error.msg)
}
Replace("reloadTechniqueLibForm",outerXml.applyAgain) & refreshTree

Replace("reloadTechniqueLibForm",outerXml.applyAgain) &
(if (isTechniqueLibraryPage) {
refreshTree
} else {
Noop
} )
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
<hr class="spacer" />
<div class="deca">
<div
class="lift:configuration.TechniqueLibraryManagement.reloadTechniqueLibrary"
class="lift:configuration.TechniqueLibraryManagement.reloadTechniqueButton"
id="reloadTechniqueLibForm">
<form class="lift:form.ajax">
<input type="submit" value="Reload" />
Expand Down

0 comments on commit 93bff87

Please sign in to comment.