Skip to content

Instantly share code, notes, and snippets.

@sfentress
Created June 3, 2010 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sfentress/424260 to your computer and use it in GitHub Desktop.
Save sfentress/424260 to your computer and use it in GitHub Desktop.
textView: SC.ScrollView.design({
hasHorizontalScroller: NO,
layout: { left: 0, top: 0, right: 0, height: 180 },
contentView: SC.LabelView.design({
layout: { left: 0, top: 0, right: 0, bottom: 0 },
isEditable: NO,
escapeHTML: NO,
valueBinding: 'Geniverse.articleController.combinedArticle',
// only check after user flips back to static (non-editing) view
checkIfHeightChanged: function() {
if (Geniverse.articleController.get('isStaticVisible')){
var timer = SC.Timer.schedule({ // wait, because flipping isn't instant
target: this,
action: 'changeHeight',
interval: 200,
repeats: NO
});
}
}.observes('Geniverse.articleController.isStaticVisible'),
changeHeight: function() {
var height = document.getElementById('article').offsetHeight; // use predefined div id
SC.Logger.log("height = "+height);
if (height > 0){
this.adjust('height', height);
}
}
})
}),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment