Permalink
Browse files

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
  • Loading branch information...
1 parent 03bbc1d commit 7f063a969383a6d9dc85e75b178fb4862b323dc2 @chillu chillu committed Apr 13, 2010
Showing with 12 additions and 10 deletions.
  1. +12 −10 javascript/WidgetAreaEditor.js
@@ -14,16 +14,6 @@ WidgetAreaEditorClass.prototype = {
if (widget.nodeType == 1) {
// Gotta change their ID's because otherwise we get clashes between two tabs
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.prototype = {
getName: function() {

0 comments on commit 7f063a9

Please sign in to comment.