BUGFIX Fixed widgets not being clickable to use them in IE (from r97545)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@102727 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-04-13 22:01:17 +00:00
parent 03bbc1d40d
commit 7f063a9693

View File

@ -14,16 +14,6 @@ WidgetAreaEditorClass.prototype = {
if (widget.nodeType == 1) { if (widget.nodeType == 1) {
// Gotta change their ID's because otherwise we get clashes between two tabs // Gotta change their ID's because otherwise we get clashes between two tabs
widget.id = widget.id + '-'+this.name; widget.id = widget.id + '-'+this.name;
if(widget.id) {
// Clicking applies to the h3 element only, not the widget div itself
var header = widget.childNodes[1];
header.onclick = function(event) {
parts = event.currentTarget.parentNode.id.split('-');
var widgetArea = parts.pop();
var className = parts.pop();
$('WidgetAreaEditor-'+widgetArea).addWidget(className, widgetArea);
}
}
} }
} }
@ -249,6 +239,18 @@ UsedWidget.prototype = {
} }
} }
AvailableWidgetHeader = Class.create();
AvailableWidgetHeader.prototype = {
onclick: function(event) {
parts = this.parentNode.id.split('-');
var widgetArea = parts.pop();
var className = parts.pop();
$('WidgetAreaEditor-'+widgetArea).addWidget(className, widgetArea);
}
}
AvailableWidgetHeader.applyTo('div.availableWidgets .Widget h3');
WidgetTreeDropdownField = Class.extend('TreeDropdownField'); WidgetTreeDropdownField = Class.extend('TreeDropdownField');
WidgetTreeDropdownField.prototype = { WidgetTreeDropdownField.prototype = {
getName: function() { getName: function() {