Skip to content

Instantly share code, notes, and snippets.

@mnickel
mnickel / gist:3866194
Created October 10, 2012 15:04
reference hell
$.Foo = function() {
this.bar = new $.Bar();
this.biz = new $.Biz();
this.bar.setBiz(biz);
this.biz.setBar(bar);
};
$.Bar = function(biz) {
this.biz;
@mnickel
mnickel / Id
Created December 16, 2010 15:53
Problem disposing a widget that has a defined id.. I'm creating a widget lyb.widgets.svgEditorViewer and giving it an id: "svgEditorViewer" so that I can refer to it in another place... However, on the dispose event I get some javascript errors in the
jojo.ns("lyb.widgets");
(function() {
lyb.widgets.booksViewer = jojo.widget.create({
name: "lyb.widgets.booksViewer",
path: "/widgets/booksViewer/booksViewer",
prototype: {
initialize: function($super, options) {
$super(options);
},
@mnickel
mnickel / CharacterElement.js
Created October 21, 2010 02:16
Learning exercise about "this" scoping and real javascript OO. Pay particular attention to this.bbox and it's use
var CharacterElement = function(locChar) {
this.x = null;
this.y = null;
this.width = null;
this.dy = null;
this.value = (locChar !== null) ? locChar : "";
this.se_newline = "";
this.characterAttribute = null;
this.bbox = null;