Tagged Questions
0
votes
1answer
11 views
Creating jquery draggable “stop” callbacks in a for loop
I have a for loop iterating through a variable number of draggable elements, creating a stop-event callback for each. The callback function needs to know the index of the item that it is linked to.
...
0
votes
1answer
24 views
jQuery/CoffeeScript: hide div if all radios are false, but show if any is true
I have a div that I need shown if a user answers yes (clicks "True" radio) to any of 4 questions. But if they answer false to all, then hide the div. What I've been having trouble with is if a user ...
0
votes
1answer
15 views
I'm `keyup` listening to elements of a class, but I want to get an attribute from the field that is “keyup'ed”
In my Rails app I am listening on a bunch of input fields with the class regex-field. I am listening with some coffeescript code. Every time I am typing into one of the input fields, the resetRegex ...
0
votes
0answers
28 views
Javascript + Rails View rendering confusion
I'm using firebase for chat in one of my rails view and I'm not properly able to capture the value of user input to display on the page. This happened when I added the jquery plugin pageslide. I must ...
0
votes
3answers
39 views
opacity 0.5 except this dd
I want to change body opacity to 0.5 except a focused area selected 'dd'.
In backbone with coffeescript;
I tried and searched for examples;
body changing but not 'dd'.
my code is:
@$el is selected ...
0
votes
2answers
25 views
Best practice: multiple CoffeeScript files on a page
I'm developing a page on my rails app that displays analytics data. It has to make several calls to the Flurry Analytics API to retrieve different events. I'm displaying each piece of data in a div ...
2
votes
1answer
28 views
Working with JSON response from jQuery (Coffeescript)
I'm trying to get data from the JSON from a http request. I'm returned 10 objects which each contain several keys. I can access a specific object but can't get to the key.
This code get me an object ...
0
votes
2answers
14 views
RailsCasts charts tutorial not displaying chart
I'm following a tutorial on charting from RailsCasts but I"m running into a bit of a problem adding my own data. The chart does not display when I try to add my data.
I was able to get the chart to ...
0
votes
2answers
26 views
Inlcuding AMD javascript as non-AMD results in library is undefined in all sorts of DOM waiting mechanisms
Trying to create an AMD Javascript library to be included in non-AMD projects. Here's my setup:
app.coffee
define ->
class App
constructor: -> console.log 'instantiating App'
init: ...
0
votes
1answer
26 views
Changing classes in specific elements using coffeescript
ftemplate = Handlebars.compile '''
<div class="filter">
<ul class="list">
<li><a href="#" class="today active">Today</a></li>
...
0
votes
2answers
56 views
Custom styled checkbox not working properly
Currently I'm using multiple blocks of the following code as my custom styled checkbox:
<div class="row-fluid">
<div class="span12 card card-even">
<div>
...
1
vote
3answers
50 views
Change coffeescript to normal javascript
I'm very beginner in javascript and right now im learning from railscast. I have problem how to write this script, writen in coffee script to normal JS. Can somebody do this:
jQuery ->
if ...
0
votes
1answer
30 views
coffescript a range of inputs
i'm trying to get a range of various inputs and i have no clue to do this on coffee, thank's for any tip.
and if i write another input on the script the first one did not work.
previewBoxWidth = 256
...
0
votes
0answers
38 views
jQuery window and document height
I learn ruby and jquery and now i try to take 2 values of site:
$(document).height()
(window).height()
Window height is 286 when i do this:
alert $(window).height()
but document height isn't ...
0
votes
2answers
34 views
Bind D3.js event to function?
Since I'm using D3.js via coffee, following codes works fine:
$ ->
force = d3.layout.force()
.on('tick', -> alert('tick triggered'))
But these don't, since at that time there isn't any ...