PDA

View Full Version : Toolbar up and running but handlers not working.



devol
16 Oct 2006, 4:19 PM
I've got my toolbar appearing and styled. When I hover over a button the style changes to ytb-button-over, but when I click nothing happens. If I set a mouseover handler same thing. I've tried a bunch of different ways of setting the handeler, but no dice.


function alertMe() {
alert("HELP!");
}
var toolbar = new YAHOO.ext.Toolbar('ltoolbar');
var tb = toolbar.addButton({
className: 'save-button',
text: "Save",
click: alertMe,
mouseover: alertMe,
tooltip: "Save this"
});
tb.enable(); // Doesn't Help
toolbar.addSeparator();


[/code]

devol
16 Oct 2006, 4:30 PM
Found it:


YAHOO.ext.util.Config = {
apply : function(obj, config){
console.log(config);
if(config){
for(var prop in config){
if(typeof config[prop] != 'function'){
obj[prop] = config[prop];
}
}
}
}
};


So if the config property is a function, it won't set it. I think you put this in for people extending Object prototype jack. EXTENDING OBJECT PROTOTYPE IS VERBOTEN!!! And this is a good reason why... [/code]

devol
16 Oct 2006, 8:04 PM
I assume this is why the new version was uploaded :)

jack.slocum
17 Oct 2006, 3:18 AM
That's exactly why. :)