publiclab/plots2

View on GitHub
app/assets/javascripts/textBoxExpand.js

Summary

Maintainability
A
0 mins
Test Coverage
function makeExpandingArea(container) {
  var area = container.find("textarea");
  var span = container.find("span");
  area.on('input propertychange', function() {
    span.text(area.val());
  });
  span.text(area.val());
 
  // Enable extra CSS
  container.addClass("active");
}

$('.expandingArea').each(function(){
  makeExpandingArea($(this));
})