# HG changeset patch # User edogawaconan # Date 1381864662 -32400 # Node ID 77c157a9e6451cb771d43bf2491a675cf5650fc6 # Parent 08dfa1a4fe4eb5e560b82b5812a56b597654b4ec Fix hash magic links. diff -r 08dfa1a4fe4e -r 77c157a9e645 app/assets/javascripts/zp.hash_magic.js --- a/app/assets/javascripts/zp.hash_magic.js Wed Oct 16 04:05:52 2013 +0900 +++ b/app/assets/javascripts/zp.hash_magic.js Wed Oct 16 04:17:42 2013 +0900 @@ -2,9 +2,13 @@ (function($) { window.zp.hash_magic = { load_hash: function() { - var format = window.location.hash.slice(1) - if (format == "") format = "pl" - zp.formatter.links().filter("[href=#" + format + "]").tab('show') + var + format = window.location.hash.slice(1), + tab_link = function(fmt) { + return zp.formatter.links().filter("[href='#" + fmt + "']") + } + if(!tab_link(format).length) format = "pl" + tab_link(format).click() }, set_hash: function(e) { if (typeof e !== "undefined") { diff -r 08dfa1a4fe4e -r 77c157a9e645 app/views/pastes/show.html.erb --- a/app/views/pastes/show.html.erb Wed Oct 16 04:05:52 2013 +0900 +++ b/app/views/pastes/show.html.erb Wed Oct 16 04:17:42 2013 +0900 @@ -12,7 +12,7 @@