« first day (17 days earlier)      last day (4938 days later) » 
00:00 - 20:0020:00 - 00:00

8:03 PM
@Tom Your sample is incomplete, is there more code?
 
Tom
@ZackMulgrew, why is it incomplete?
 
@Tom Well, if I were to try and run it in my browser it won't work because "instances" isn't defined, etc.
 
Can someone help me out with a method that properly sorts nodes after this drag/drop event occurs? I setup a detailed jsfiddle here: jsfiddle.net/danmasq/BkNAF Would really appreciate a look!
 
Tom
@ZackMulgrew, this is the whole object, object is created with new somewhere else:
gist: 660203, 2010-11-02 20:05:41Z
//SourceSubmissionForm: creates a form used for source submission

var SourceSubmissionForm = function() {
	var _thisInstance = this;
	
	//instance members
	this.index = -1;
	this.element = null;
	this.value = "";
	
	//add this instance to list
	SourceSubmissionForm.instances.push(this);
	
	//update index
	this.index = SourceSubmissionForm.instances.length - 1;
	
	//create new form
	this.element = $('<textarea id="sourceForm' + this.index + '"/>');
	this.element.css({'width' : '200px', 'height' : '200px'});
	this.element.appendTo("#mid1");
	
	//register change event
	this.element.change(function() {
		_thisInstance.onTextChange();
	});
};

//static members
SourceSubmissionForm.instances = [];

//proto methods
SourceSubmissionForm.prototype.onTextChange = function() {
	console.log("inner update");
	this.value = $(this.element).val();
};
 
@Tom Which browsers? It seems to be defined and is a function when I test in Chrome.
 
Tom
8:08 PM
@ZackMulgrew I tried it in firefox
 
@Tom Works for me in FF 3.6.10.
Have you tried just looking at what's in the prototype of your instance?
I'm just doing this btw: var test = new SourceSubmissionForm(); and then updating the test in the textbox that gets added.
I see "inner update" in the console after I do that.
 
Tom
@ZackMulgrew, strange, it doesn't output inner update me when I do that, it stops when the event fires because onTextChange is not defined
 
@Tom That really is weird -- it works for me in IE6, too. Are there other things going on in your page or are you testing from the gist too?
 
Tom
Im not testing from git no @ZackMulgrew, let me try jsfiddle
@ZackMulgrew, that jsfiddle does work for me
 
Same.
Maybe you're trashing the prototype somewhere else on your page or in another file?
 
Tom
8:18 PM
@ZackMulgrew, let me try to reproduce it in jsfiddle
 
@Tom Or, is it possible that your instances are created before you set the methods in the prototype?
I don't actually know if that would be a problem, just speculating...
 
Tom
@ZackMulgrew see jsfiddle.net/SnFF6/1
I am using my own hook based glueing there
It works :/ Strange, because I use the same code in production
 
@Tom Yeah, works for me too in Chrome/FF.
 
Tom
Well.. not sure what is different in my code
Probably something weird going on with my hooking library
 
8:41 PM
Is getTime() returns in local or UTC time?
 
9:26 PM
@MarkK MDC says "Returns the numeric value corresponding to the time for the specified date according to universal time." developer.mozilla.org/en/JavaScript/Reference/Global_Objects/…
 
 
2 hours later…
11:38 PM
Dang, I think jsFiddle's down.
 
11:53 PM
nm, it's back now.
 
00:00 - 20:0020:00 - 00:00

« first day (17 days earlier)      last day (4938 days later) »