Sha256: a1871989fadd5cf6cbc29e665418aaeec71750142594a211d4da1d651a66a84b

Contents?: true

Size: 440 Bytes

Versions: 2

Compression:

Stored size: 440 Bytes

Contents

$(document).ready(function() {

  neutral = $("div.neutral").find("<%= by_url %>").parent();

  neutral.find("span#positive").html("<%= voting.positive.nonzero? %>");
  neutral.find("span#negative").html("<%= voting.negative.nonzero? %>");
  neutral.find("span#difference").html("<%= voting.difference.nonzero?.try(:abs) %>");

  neutral.find("span#difference").attr("class", "<%= voting.difference > 0 ? 'positive' : 'negative' %>");

});

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
neutral-0.0.2 app/views/neutral/votes/update.js.erb
neutral-0.0.1 app/views/neutral/votes/update.js.erb