#30 ✓hold
Steve Vanspall

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

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.

New-ticket Create new ticket

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.

Attachments

Pages