Modal without Object.Event
Sorry, more information about this:
I'm using prototype version 1.5.1, and scriptaculous. When I add the Modal js file I get a js error: Object.Event.extend is not a function occurs on line 552 in the following context: if(typeof(Object.Event) != 'undefined') { Object.Event.extend(Control.Modal);
When I add the Object.Event js I get a different error: Event.observers[i] has no properties
Is there anyone that has seen, or knows what could be causing this?
Thanks in advance for your help!
Posted June 20th, 2007 at 4:52pm by duaneatat
Sounds like something else may be the culprit. Can you post a URL?
My reason for thinking this is that the Control.Modal project page for instance does not have Object.Event included...
Posted June 21st, 2007 at 12:30pm by ryan
I'm actually getting the exact same error--in the same environment. Also using lowpro, not sure if that has any affect.
Posted July 20th, 2007 at 10:54am by mike
I just happen to see this error as well and tracked it as follows:
we had an older version of control.textarea.js running which contains just:
if(typeof(Object.Event) == 'undefined'){
Object.Event = {
eventHandlers: {},
observe: function(event_name,observer){
if(!this.eventHandlers[event_name])
this.eventHandlers[event_name] = $A([]);
this.eventHandlers[event_name].push(observer);
},
stopObserving: function(event_name,observer){
this.eventHandlers[event_name] = this.eventHandlers[event_name].without(observer);
},
fireEvent: function(event_name){
if(this.eventHandlers[event_name]){
this.eventHandlers[event_name].each(function(observer){
observer(this);
}.bind(this));
}
}
};
Object.Event.createEvent = Object.Event.fireEvent;
}
Object.Event has no function extend on this older version (1.x) and clashes then with an updated version of Control.Modal (which happens to be updated in our case).
I'd recommend updating all Control.* files ;)
Posted July 27th, 2007 at 8:44am by phroggar
Just wanted to add that after upgrading control.textarea.js i ran into problems with the markdown extension giving some errors when using the preview pane. I haven't had the time to debug it completely - anyone any ideas?
I'm getting
this.textarea.observe is not a function
in Firebug adressing line 25 in Control.TextArea.ToolBar.Markdown:
/**
* @author Ryan Johnson
* @copyright 2007 LivePipe LLC
* @package Control.TextArea.ToolBar.Markdown
* @license MIT
* @url http://livepipe.net/projects/control_textarea/
* @version 1.0.1
*/
Control.TextArea.ToolBar.Markdown = Class.create();
Object.extend(Control.TextArea.ToolBar.Markdown.prototype,{
textarea: false,
toolbar: false,
options: {},
initialize: function(textarea,options){
this.textarea = new Control.TextArea(textarea);
this.toolbar = new Control.TextArea.ToolBar(this.textarea);
this.converter = (typeof(Showdown) != 'undefined') ? new Showdown.converter : false;
this.options = {
preview: false,
afterPreview: Prototype.emptyFunction
};
Object.extend(this.options,options || {});
if(this.options.preview){
this.textarea.observe('change',function(textarea){
if(this.converter){
$(this.options.preview).update(this.converter.makeHtml(textarea.getValue()));
this.options.afterPreview();
}
}.bind(this));
}
Posted July 27th, 2007 at 10:11am by
FYI, just including the Modal js will give a js error, you need to include the Object.Event js to avoid this.
Posted June 20th, 2007 at 4:29pm by duaneatat