Skip to content

Commit 5c3be75

Browse files
committed
For #6102: add inline loading indicator to reload button
1 parent e43e188 commit 5c3be75

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

form-runner-web/src/main/scala/org/orbeon/fr/FormRunnerApp.scala

+6-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
package org.orbeon.fr
1515

16-
import org.orbeon.facades.ResizeObserver
16+
import org.orbeon.facades.{Ladda, ResizeObserver}
1717
import org.orbeon.web.DomEventNames
1818
import org.orbeon.web.DomSupport.*
1919
import org.orbeon.xbl
@@ -121,10 +121,14 @@ object FormRunnerApp extends App {
121121
})
122122

123123
val reloadButton = dialog.querySelectorT(".fr-reload-button")
124+
val laddaReloadButton = Ladda.create(reloadButton)
124125
GlobalEventListenerSupport.addListener(
125126
target = reloadButton,
126127
name = DomEventNames.Click,
127-
fn = (_: dom.EventTarget) => dom.window.location.href = dom.window.location.href
128+
fn = (_: dom.EventTarget) => {
129+
laddaReloadButton.start()
130+
dom.window.location.href = dom.window.location.href
131+
}
128132
)
129133

130134
Session.addSessionUpdateListener(sessionUpdate)

form-runner/jvm/src/main/resources/apps/fr/components/view.xsl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1274,7 +1274,7 @@
12741274
<xh:button class="btn btn-primary fr-renew-button">
12751275
<xf:output value="$fr-resources/detail/session-expiration/renew-button"/>
12761276
</xh:button>
1277-
<xh:button class="btn btn-primary fr-reload-button">
1277+
<xh:button class="btn btn-primary fr-reload-button ladda-button" data-style="slide-left">
12781278
<xf:output value="$fr-resources/detail/session-expiration/reload-button"/>
12791279
</xh:button>
12801280
</xh:div>

0 commit comments

Comments
 (0)