Created
March 22, 2012 01:15
-
-
Save sleepynate/2154978 to your computer and use it in GitHub Desktop.
backbone derp?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RedrawCheckbox = Backbone.View.extend({ | |
el: '#redrawCheckbox', | |
events: { | |
'click' : 'checkState' | |
}, | |
checkState: function() { | |
this.trigger('redrawOnMove', this.$el.is(':checked')); | |
} | |
}); | |
/** and in the jasmine spec **/ | |
it('sets state in the analyzer when clicked about whether or not to redraw while dragging sliders', function() { | |
expect(this.a.sampleslider.redrawOnMove).toBe(false); | |
expect(this.a.ampslider.redrawOnMove).toBe(false); | |
$('#redrawCheckbox').click(); | |
//this.a.redrawCheckbox.trigger('click'); | |
expect(this.a.sampleslider.redrawOnMove).toBe(true); | |
expect(this.a.ampslider.redrawOnMove).toBe(true); | |
}); | |
<!-- markup --> | |
<table class="buttonHolder"> | |
<tr> | |
<td> | |
<input type="checkbox" id="redrawCheckbox" /> | |
<label for="redrawCheckbox">Check here to allow update | |
the wave as controls are changed. (Can be very slow on | |
non-GL browsers!)</label> | |
</td> | |
<td> | |
<input type="button" id="redrawButton" value="Redraw the wave" /> | |
</td> | |
<td> | |
<div class="buttonHolder"> | |
<input type="button" id="playback" value="Play" /> | |
</div> | |
</td> | |
</tr> | |
The good news is, if you ever need someone to break your JS, call me.
I don't care what @magnusstahre says about you, you're a swell dude.
Haha :D
Something is seriously messed up with those views, they aren't getting the normal jQuery event arguments proxied to them....
I even took jquery ui and those extra slider//dragslider plugins out of the equation and it's still borked, hmm.. still hacking :P
Breaking jquery es Brazil #1 huehuehuehue
…On Mar 30, 2012 1:53 AM, "David Mosher" < ***@***.***> wrote:
Something is seriously messed up with those views, they aren't getting the
normal jQuery event arguments proxied to them....
I even took jquery ui and those extra slider//dragslider plugins out of
the equation and it's still borked, hmm.. still hacking :P
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/2154978
First test green, fixing second then i'll give you a pull request with comments on what went wrong.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I just cloned the repo, hacking at it :)