From 81b2c8eef264afec6b3accaea24dc7aed6eec778 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Wed, 29 Jan 2014 17:51:19 +0100 Subject: [PATCH] Add catalog switcher button in the inline catalog. --- src/General/Index.coffee | 9 +++++++++ src/General/Main.coffee | 1 + 2 files changed, 10 insertions(+) diff --git a/src/General/Index.coffee b/src/General/Index.coffee index 0f3ff07f5..76eaf45e1 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -146,6 +146,15 @@ Index = val: isPinned: thread.isPinned Index.sort() Index.buildIndex() + addCatalogSwitch: -> + a = $.el 'a', + href: 'javascript:;' + textContent: 'Switch to <%= meta.name %>\'s catalog' + className: 'btn-wrap' + $.on a, 'click', -> + $.set 'Index Mode', 'catalog' + window.location = './' + $.add $.id('info'), a rmCatalogLinks: -> $.addClass doc, 'removing-catalog-links' $.ready -> diff --git a/src/General/Main.coffee b/src/General/Main.coffee index d8dc3014b..68bcade5f 100644 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -12,6 +12,7 @@ Main = else 'index' if g.VIEW is 'catalog' + $.ready Index.addCatalogSwitch return if g.VIEW is 'thread' g.THREADID = +pathname[3]