opensmarthouse / opensmarthouse-web

Provides public elements of OpenSmartHouse web site including ZWave database import/export and log file processors.
0 stars 2 forks source link

Return to previous page after login #12

Closed 5iver closed 4 years ago

5iver commented 4 years ago

When you go to the site to quickly look something up and are viewing a device, if you decide to login to make a change, you go to the home screen. It would be very nice to go back to the device you were viewing after logging in.

bwosborne2 commented 4 years ago

I second that idea đź‘Ť

cdjackson commented 4 years ago

I fully agree - it's just not simple as it seemed. I spent some time looking at different options this afternoon, but didn't find a simple, reliable method yet. You'd think this would be super simple!

bwosborne2 commented 4 years ago

Would this help? https://perishablepress.com/go-back-via-javascript-and-php/ I know I have a "back button" createdand in production. I can check later what I used after I return to work.

cdjackson commented 4 years ago

I tried various incarnations of the “back” command, but couldn’t get it to work. Some of this may be related to Wappler running js on completion of the login api so I might try and abstract this away.

cdjackson commented 4 years ago

Yes, the issue was I couldn’t run JS direct in the Wappler event, but adding a level of abstraction made it work.

bwosborne2 commented 4 years ago

Here is what I use on a page. I stripped out my css styling

<button id="backbutton" type="button" onclick="location.href='javascript:history.back();';">Back</button>

cdjackson commented 4 years ago

As mentioned - the issue was just with the way that Wappler called the javasctipt and I had to add a level of abstraction to sort it.

Do I assume that it's still not working Bruce?

bwosborne2 commented 4 years ago

I do not know. I promised sharing my solution after I returned to work. I did not think it was a solution I posted in the links.

cdjackson commented 4 years ago

@bwosborne2 I just re-checked it here, and it was working fine on both Chrome and Safari and it's working fine for me. Maybe it's a browser issue - what browser are you using.

cdjackson commented 4 years ago

I promised sharing my solution after I returned to work.

Ah - ok. So it's working ok though?

bwosborne2 commented 4 years ago

I have not checked.

5iver commented 4 years ago

I just went to a device, logged in, and I went back to the device page using FF.

cdjackson commented 4 years ago

Thanks Scott - ok, so I think this looks like it's working ok then so I'll close this.