Welcome, guest | Sign In | My Account | Store | Cart

This Komodo macro is an example to show how to programmatically re-position a Komodo editor tab. This macro moves the currently selected tab to the start of the tab list.

JavaScript, 8 lines
1
2
3
4
5
6
7
8
// Get the XUL tabbox element (it contains XUL *tabs* and *tabpanels* elements).
// Note: This may not work correctly for Komodo split views.
var tabbox = document.getElementById("tabbed-view");
var tabs = tabbox.tabs;
// Move the tab to the start.
tabs.insertBefore(tabs.selectedItem, tabs.firstChild);
// Ensure it's visible.
tabs.scrollBoxObject.ensureElementIsVisible(tabs.firstChild);