Skip to content

Instantly share code, notes, and snippets.

@ialexi
Created October 29, 2009 19:36
Show Gist options
  • Select an option

  • Save ialexi/221733 to your computer and use it in GitHub Desktop.

Select an option

Save ialexi/221733 to your computer and use it in GitHub Desktop.
didUpdateLayer: function()
{
sc_super();
var layer = this.get("layer");
if (!layer) return;
var ows = layer.style.whiteSpace, opos = layer.style.position, ow = layer.style.width,
oh = layer.style.height;
layer.style.whiteSpace = "pre";
layer.style.position = "absolute";
layer.style.width = "";
layer.style.height = "";
this.set("measuredWidth", layer.clientWidth);
this.set("measuredHeight", layer.clientHeight);
layer.style.whiteSpace = ows, layer.style.position = opos, layer.style.width = ow,
layer.style.height = oh;
this.layoutDidChange();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment