Kallithea issues archive

Issue #343: Browser back button broken in source viewer

Reported by: Rob Agar
State: resolved
Created on: 2019-04-30 10:10
Updated on: 2019-05-04 19:27

Description

The Chrome browser back button has no effect when viewing a file source.

This error appears in the console

ExampleDevice.yaml:671 Uncaught ReferenceError: State is not defined
at load_state (ExampleDevice.yaml:671)
at ExampleDevice.yaml:793

I thought the fix would be a simple typo fix “State.url” → “state.url” in templates/files/files.html

104             asynchtml(State.url, $files_data, function() {
105                   post_load_state(state);
106                   var expire_on = new Date().getTime() + CACHE_EXPIRE;
107                   CACHE[cache_key] = [expire_on, $files_data.html()];
108             });

but this change gets rid of the console error, but does not actually make the back button work

Attachments

Comments

Comment by Thomas De Schampheleire, on 2019-04-30 11:16

Could you please try following commit I pushed yesterday?

https://kallithea-scm.org/repos/kallithea/changeset/b293ec74ef989195daaeb33fd5259bfd01dbe5b8

I’m not sure if it fixes this particular issue but when making it I also bumped into some state stuff.

The typo fix you made seems also relevant.

Comment by Thomas De Schampheleire, on 2019-04-30 11:20

Comment by Rob Agar, on 2019-04-30 16:15

Hi Thomas - the capitalized “State” is still there, so I still get the error in the console. If I manually fix the typo the back button behaves oddly - the Select Changeset drop down gets duplicated! (The browser doesn’t navigate back to the previous page.)

Comment by Mads Kiilerich, on 2019-04-30 16:28

Agreed - something is very broken.

Comment by Mads Kiilerich, on 2019-04-30 17:49

Comment by Mads Kiilerich, on 2019-04-30 22:28

Fixes has been pushed. Please, can you test from the head of the stable branch?

Comment by Rob Agar, on 2019-05-01 09:49

Looks good to me 👍

Comment by Thomas De Schampheleire, on 2019-05-04 19:27

Fixed with commits fa2f020, 6b7a0cd, b1e2ae0, and 7135fd2