comparison app/assets/javascripts/zp.viewer_width.js @ 214:22c4b5f90e24

Massive javascript and html refactor. Also, ie9
author Edho Arief <edho@myconan.net>
date Sun, 12 May 2013 02:43:38 +0900
parents
children f057e8c78e50
comparison
equal deleted inserted replaced
213:0993715b455d 214:22c4b5f90e24
1 (function($) {
2 window.zp.viewer_width = {
3 links: function() { return $("#paste-resize ul li a") },
4 current: "auto",
5 resize: function(width) {
6 var
7 paste = $("#paste"),
8 title = $("#paste-resize .btn")
9 title.text(title.data("base").replace(":size:", width))
10 this.current = width
11 if (width == "auto") {
12 paste.css("width", "")
13 } else {
14 paste.css("width", width)
15 }
16 zp.hash_magic.set_hash()
17 },
18 do_switch: function(e) {
19 this.resize($(e.target).text())
20 },
21 init: function() {
22 this.links().click($.proxy(this.do_switch, this))
23 }
24 }
25 })(jQuery)