Skip to content

Commit

Permalink
BUGFIX Fixed widgets not being clickable to use them in IE (from r97545)
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@102727 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information
chillu committed Apr 13, 2010
1 parent 03bbc1d commit 7f063a9
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions javascript/WidgetAreaEditor.js
Expand Up @@ -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);
}
}
} }
} }


Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 7f063a9

Please sign in to comment.