Commit 8c9d92886abd0ffb2e6249fb293c505d3fb5b490
- Diff rendering mode:
- inline
- side by side
public/custom.js
(16 / 5)
|   | |||
| 65 | 65 | } | |
| 66 | 66 | } | |
| 67 | 67 | ||
| 68 | function bind_key() { | ||
| 69 | $(window).bind('keypress', function (e) { | ||
| 70 | if (e.which == 103) { | ||
| 71 | scroll_to(); | ||
| 72 | } | ||
| 73 | }); | ||
| 74 | } | ||
| 75 | |||
| 76 | function unbind_key() { | ||
| 77 | $(window).unbind('keypress'); | ||
| 78 | } | ||
| 79 | |||
| 68 | 80 | $(document).ready( | |
| 69 | 81 | function() { | |
| 70 | 82 | jQuery.fn.fadeToggle = function(speed, easing, callback) { | |
| 71 | 83 | return this.animate({opacity: 'toggle'}, speed, easing, callback); | |
| 72 | 84 | } | |
| 73 | 85 | ||
| 74 | $(window).bind('keypress', function (e) { | ||
| 75 | if (e.which == 103) { | ||
| 76 | scroll_to(); | ||
| 77 | } | ||
| 78 | }); | ||
| 86 | bind_key(); | ||
| 79 | 87 | ||
| 80 | 88 | $('.domw_reply_to').openDOMWindow( | |
| 81 | 89 | { | |
| … | … | ||
| 130 | 130 | update_destination("identica"); | |
| 131 | 131 | update_in_reply_to(""); | |
| 132 | 132 | $(".post").fadeToggle("fast"); | |
| 133 | bind_key(); | ||
| 133 | 134 | }, | |
| 134 | 135 | error: function(xhr, textStatus, errorThrown) { | |
| 135 | 136 | alert("Failure: " + xhr.responseText); | |
| … | … | ||
| 176 | 176 | clear_textentry(); | |
| 177 | 177 | if ( $(".post").is(":visible") ) { | |
| 178 | 178 | $(".post").fadeToggle("fast"); | |
| 179 | bind_key(); | ||
| 179 | 180 | } else { | |
| 181 | unbind_key(); | ||
| 180 | 182 | $(".post").fadeToggle("fast") | |
| 181 | 183 | $("#post_textarea").focus(); | |
| 182 | 184 | } |

