diff --git a/plugins/tabs/tabs.coffee b/plugins/tabs/tabs.coffee index e62bee973..faa4350c9 100644 --- a/plugins/tabs/tabs.coffee +++ b/plugins/tabs/tabs.coffee @@ -8,43 +8,38 @@ File = require 'fs' # click tab $(document).delegate '#tabs ul li:not(.add) a', 'click', -> - switchToTab this + tabs.switchToTab this false # click 'add' tab $(document).delegate '#tabs .add a', 'click', -> - addTab() + tabs.addTab() false # toggle bindKey 'toggleTabs', 'Command-Ctrl-T', (env) -> if $('#tabs').length - hideTabs() + tabs.hideTabs() else - showTabs() + tabs.showTabs() -showTabs = -> - Chrome.addPane 'top', require('tabs/tabs.html') - $('#tabs').parents('.pane').css height: 'inherit' - css = $('').html require 'tabs/tabs.css' - $('head').append css +module.exports = tabs = + showTabs: -> + Chrome.addPane 'top', require 'tabs/tabs.html' + $('#tabs').parents('.pane').css height: 'inherit' + css = $('').html require 'tabs/tabs.css' + $('head').append css -hideTabs = -> - $('#tabs').parents('.pane').remove() - $('#tabs-style').remove() + hideTabs: -> + $('#tabs').parents('.pane').remove() + $('#tabs-style').remove() -addTab = -> - $('#tabs ul .add').before '