Permalink
Browse files

limit url updates to after the slider stops moving

  • Loading branch information...
1 parent c7a40aa commit d4de64ede10707eee0171830fb2791eaf1006557 @imathis committed Apr 30, 2013
Showing with 9 additions and 8 deletions.
  1. +2 −0 assets/javascripts/lib/dragdealer.js
  2. +7 −8 assets/javascripts/modules/site.coffee
@@ -262,6 +262,8 @@ Dragdealer.prototype =
{
this.stopDrag();
this.stopTap();
+ $(this.handle).trigger('dang');
+ //console.log('dang')
//this.cancelEvent(e);
},
documentResizeHandler: function(e)
@@ -24,14 +24,14 @@ site = Backbone.View.extend
events:
'click .url' : 'selectUrl'
'click .show-more' : 'toggleWhy'
+ 'dang .handle' : 'setUrl'
updateColor: ->
color = @model.hsla()
tile = @model.get 'tile'
opt = {}
opt[tile] = color
@model.set opt
- @setUrl()
@setPageStyles() if tile is 'foreground'
selectUrl: (e)->
@@ -64,14 +64,13 @@ site = Backbone.View.extend
hash = @getColorUrl @model.get 'foreground'
background = @model.get 'background'
hash += "/#{@getColorUrl background}" if background[3] > 0
-
- input=$('.url')
url = "#{host}/#{hash}"
- update = @throttle ((h)-> window.location.replace(h)), 300
- update(hash)
- width = url.length*7.8
- input.css width: width
- input.val(url)
+ unless url is (window.location.host + '/' + window.location.hash)
+ input=$('.url')
+ window.location.replace(hash)
+ width = url.length*7.8
+ input.css width: width
+ input.val(url)
getColorUrl: (color)->
frag = @model.hslToHex color

0 comments on commit d4de64e

Please sign in to comment.