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 '
  • untitled
  • ' - $('#tabs ul .active').removeClass() - $('#tabs ul .add').prev().addClass 'active' + addTab: -> + $('#tabs ul .add').before '
  • untitled
  • ' + $('#tabs ul .active').removeClass() + $('#tabs ul .add').prev().addClass 'active' -switchToTab = (tab) -> - $('#tabs ul .active').removeClass() - $(tab).parents('li').addClass 'active' - - -exports.show = exports.showTabs = showTabs -exports.hideTabs = hideTabs -exports.addTab = addTab -exports.switchToTab = switchToTab \ No newline at end of file + switchToTab: (tab) -> + $('#tabs ul .active').removeClass() + $(tab).parents('li').addClass 'active' \ No newline at end of file