Skip to content

Commit 032671f

Browse files
committed
live-web-edit: WorkspaceView: Added configurable frame reloader.
1 parent 5c685e1 commit 032671f

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

packages/live-web-edit/view/workspace/WorkspaceView.lv

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ component WorkspaceView < Div{
5454
workspaceView._workspaceViewActions.forkTemplate(name)
5555
workspaceView.data.workspaceSelector = false
5656
}
57+
Object reloadFrameHandler = (wsView) => {
58+
if ( wsView.data.workspaceViewUrl !== wsView.data.workspaceName ){
59+
wsView.data.workspaceViewUrl = wsView.data.workspaceName
60+
}
61+
wsView.frame.refresh()
62+
}
5763

5864
constructor(data:Object){
5965
super()

packages/live-web-edit/view/workspace/data/WorkspaceViewActions.lv

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ component WorkspaceViewActions{
77
super()
88
this.workView = workView
99
this.catchError = this._catchError.bind(this)
10-
WorkspaceViewActions.prototype.__initialize.call(this)
10+
this{}
1111
}
1212

1313
fn refreshFrame(){
@@ -25,7 +25,6 @@ component WorkspaceViewActions{
2525
this.workView.data.loadingStatus = null
2626
if ( result.name ){
2727
window.history.pushState(null, null, this.workView.data.route(`/w/${this.workView.data.workspaceName}`))
28-
this.refreshFrame()
2928
}
3029
} catch ( e ){
3130
this._catchError(e)
@@ -167,10 +166,7 @@ component WorkspaceViewActions{
167166
.then( res => {
168167
this.workView.data.loadingStatus = null
169168
if ( res ){
170-
if ( this.workView.data.workspaceViewUrl !== this.workView.data.workspaceName ){
171-
this.workView.data.workspaceViewUrl = this.workView.data.workspaceName
172-
}
173-
this.refreshFrame()
169+
this.workView.reloadFrameHandler(this.workView)
174170
}
175171
})
176172
.catch(this.catchError)

0 commit comments

Comments
 (0)