rayantony / jixedbar

Automatically exported from code.google.com/p/jixedbar
GNU General Public License v2.0
0 stars 0 forks source link

Bar does not remember its hidden state when navigating from page to page #44

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Visit a page that has the jixedbar 0.0.5 showing, then click its Hide button.
2. Leave the page and then come back (or just reload the same page)
3. Notice that the bar is not hidden!

What is the expected output? What do you see instead?

Expectation is that the jixedbar should remember its state, and should remain 
hidden. (This is how it used to work in v0.0.3 actually, but does not work in 
0.0.5 anymore.)

What version of the product are you using? On what operating system?
v0.0.5

Please provide any additional information below.

I traced this problem down to a change that was made to the checkCookie 
function in 0.0.5. Some curly braces were added after an "if" statement, which 
erroneously includes the "return true" as part of its condition, instead of 
letting this return always execute.

Here is how I fixed this: (Please consider for fixing in 0.0.6?)

if (cookie_end == -1) {
    cookie_end = document.cookie.length;
    //return true;   // no!!! does not belong here!
}
return true; // this is where it actually belongs!

Even though the indentation is a little weird in the 0.0.3 version, you'll see 
that it is functionally quite different than what is found in 0.0.5.

Original issue reported on code.google.com by funka...@gmail.com on 5 Nov 2010 at 1:04

GoogleCodeExporter commented 9 years ago
OK, I have something else to add, not sure if this should be a separate item 
since the cause is completely different, but the end result is the same in 
that, truly, the bar "does not remember its hidden state when navigating from 
page to page" (the title of my previous issue is the same as this new issue i'd 
like to raise!)

What steps will reproduce the problem?
1. Visit a page in a subfolder of your site (e.g., /about/) that has the 
jixedbar showing, then click its Hide button.
2. Leave the page and go to a page in another subfolder of your site, e.g., 
/contact/
3. Notice that the bar is not hidden!

What is the expected output? What do you see instead?
I expect the bar should remain hidden

What version of the product are you using? On what operating system?
v0.0.5

Please provide any additional information below.
It seems the jixedbar creates a cookie to save its visible/hidden state. 
However, this cookie is not created for the root of the website, it is created 
for just the path you are in. Thus, if you have 27 different 
directories/folders in your site, you end up with at least 27 different cookies.

Recommendation: either allow an option if people like this behavior, otherwise, 
store the cookie in the root path of the site ("/") so that navigation 
throughout the site will remember your hidden preference. (And you won't end up 
with so many cookies being created!!)

Original comment by funka...@gmail.com on 5 Nov 2010 at 1:17