Control.Tabs does not handle pages with base tag specified
Reported by Steve Vanspall | September 20th, 2008 @ 05:46 PM | in 1.0
We are using Livepipe tabs as part of a web application we are developing.
The nature of our app required us to add a tag that was something other than the main window base href.
This broke livepipe tabs. The reason I found was that the hrefs for anchor were being accessed using a.href. This behaves differently in different browsers. I converted these to use a.readAttribute('href') which is the optimal way of doing things (if using the Prototype Library).
Looking at the way the href property is handled it seems to try to compensate for the fact the browsers will prepend the window.location.href onto the link specified in the actual html code. As prototype readAttribute gives you the actual link specified int he HTML and not the link after the browser has interpreted it, it seems this code is no longer necessary. So I removed it. Example:
((Prototype.Browser.WebKit ? decodeURIComponent(link.href) : link.href).replace(window.location.href.split('#')[0],''));
I also chose to refactor code in the initialize method out into sub methods. This is just for readability reasons.
As not using the Prototype API functions caused the problem, I also converted all non Prototype API functions to use the Prototype Library.
e.g.
typeof(object) == 'string' to Object.isString(object)
document.findByTagName('a') to $$('a')
I wasn't sure about checking it directly into git.
I have tested the changes by saving a copy of livepipes web pages and getting them to load the changes tabs library. Everything seems to work. However, you may want to test it out for yourself.
Hope it's of use
Steve
Comments and changes to this ticket
-
Steve Vanspall April 20th, 2009 @ 03:31 PM
Interesting,
The application I use this in works on both IE6 and 7. Will have another look at it.
-
Nathan L Smith August 9th, 2009 @ 07:07 PM
- State changed from unconfirmed to hold
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
NOTE: Please do not open tickets here. If you have an issue, please open it on http://github.com/syntacticx/livepipe-ui/issues/
High quality widgets and controls for web 2.0 applications built using the Prototype JavaScript Framework. Each control is well tested, highly extensible, fully documented and degrades gracefully for non JavaScript enabled browsers where possible. MIT licensed and actively maintained.