comparison app/assets/javascripts/zp.hash_magic.js @ 264:fa4a1ba990ae

Simplified pastes#show view.
author edogawaconan <me@myconan.net>
date Wed, 16 Oct 2013 02:19:36 +0900
parents a9c45375a656
children 77c157a9e645
comparison
equal deleted inserted replaced
263:a9c45375a656 264:fa4a1ba990ae
1 //= require zp.formatter 1 //= require zp.formatter
2 (function($) { 2 (function($) {
3 window.zp.hash_magic = { 3 window.zp.hash_magic = {
4 load_hash: function() { 4 load_hash: function() {
5 var format = window.location.hash.slice(1) 5 var format = window.location.hash.slice(1)
6 if (format !== undefined) { 6 if (format == "") format = "pl"
7 zp.formatter.links().filter("[href=#" + format + "]").click() 7 zp.formatter.links().filter("[href=#" + format + "]").tab('show')
8 }
9 }, 8 },
10 set_hash: function(e) { 9 set_hash: function(e) {
11 if (typeof e !== "undefined") { 10 if (typeof e !== "undefined") {
12 if (zp.formatter.links().filter(e.target).length === 0) return 11 if (zp.formatter.links().filter(e.target).length === 0) return
13 else e.preventDefault() 12 else e.preventDefault()