Permalink
Browse files

minor

  • Loading branch information...
1 parent 1203a18 commit 99b3065f7e3cc4ce06f8e8929f7fd9232d299a66 @defunkt defunkt committed Mar 8, 2010
Showing with 9 additions and 14 deletions.
  1. +9 −14 tom.coffee
View
23 tom.coffee
@@ -1,11 +1,5 @@
-####
-# Scrolls the window to element:
-# $('element').scrollTo()
+# Scrolls the window to element at the specified speed:
# $('element').scrollTo(speed)
-#
-# Scrolls element1 to element2:
-# $('element1').scrollTo($('element2'))
-# $('element1').scrollTo($('element2'), speed)
$.fn.scrollTo: (speed) ->
target: this
container:'html,body'
@@ -17,18 +11,19 @@ $.fn.scrollTo: (speed) ->
$ ->
$('#demo').click ->
$('#demo-box').toggle()
- if $('#demo-box:visible').length > 0
+ if $('#demo-box:visible').length > 0
$('#demo').scrollTo(1)
- window.location.hash: '#demo'
- else
+ window.location.hash: '#demo'
+ else
window.location.hash: ''
false
-
- $('#demo').click() if window.location.hash is "#demo"
-
+
+ $('#demo').click() if window.location.hash is "#demo"
+
$('.run').click ->
template: $('.template').val()
json: $.parseJSON $('.json').val()
html: Mustache.to_html(template, json).replace(/^\s*/mg, '')
+
$('.html').text(html).scrollTo(1)
- Highlight.highlightDocument()
+ Highlight.highlightDocument()

0 comments on commit 99b3065

Please sign in to comment.