Ejemplo n.º 1
0
    function init() {
        var thisdoc = document._currentScript.ownerDocument;

        // Create the panel
        my._panelId = uuid();
        var panel = thisdoc.createElement("div");
        panel.setAttribute('id', my._panelId);

        my._containerId = uuid();
        my._container = thisdoc.createElement("div");
        my._container.setAttribute('id', my._containerId);
        panel.appendChild(my._container);

        // Load the tabs template up
        var elem = thisdoc.getElementById('sidebar-template');
        var template = $(elem).html();
        $(my._container).html(template);

        // Add the sidebar to the page
        document.body.appendChild(panel);

        // Create the tabs using jquery ui
        my._tabs = document.getElementById('sidebar-api-tabs');
        my._tabsList = document.getElementById('sidebar-api-tabs-ul');
        $(my._tabs).tabs();

        // This contains the div objects, as well as name, etc.
        my._tabsOrdered = [];

        $(panel).BootSideMenu({side:"right", autoClose:false});

    }
Ejemplo n.º 2
0
 function addTab(name) {
     var id = uuid();
     // Create the div
     var newDiv = document.createElement('div');
     newDiv.setAttribute('id', id);
     // Add the div to the
     my._tabsOrdered.push({
         id: id,
         name: name,
         div: newDiv
     });
     render();
     return id;
 }