Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved compatibility with "How Many Times Can I Back?" (#397) #554

Merged
merged 2 commits into from
Sep 12, 2013
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Improved compatibility with "How Many Times Can I Back?" (#397)
"getCommonAncestor" method is not available without jQuery
  • Loading branch information
wanabe committed Sep 12, 2013
commit 1a833760344575f9da132486eff758001ff71d5e
14 changes: 10 additions & 4 deletions modules/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1079,10 +1079,16 @@ TreeStyleTabBrowser.prototype = {

namedNodes.closeAnchor = namedNodes.label;
if (namedNodes.closeAnchor.parentNode != namedNodes.close.parentNode) {
let containerFinder = d.createRange();
containerFinder.selectNode(namedNodes.closeAnchor);
containerFinder.setEndAfter(namedNodes.close);
let container = containerFinder.getCommonAncestor();
let containerFinder = namedNodes.closeAnchor;
let containers = [];
while (containerFinder != aTab) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this project, I use the style:

while (...)
{

instead of

while (...) {

for "while", "for", "switch" blocks. So, in the future, please fit your patch to existing styles ;-)

containerFinder = containerFinder.parentNode;
containers.push(containerFinder);
}
let container = namedNodes.close;
while (containers.indexOf(container) < 0) {
container = container.parentNode;
}
while (namedNodes.closeAnchor.parentNode != container)
{
namedNodes.closeAnchor = namedNodes.closeAnchor.parentNode;
Expand Down