mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
MINOR fixed widget area
MINOR added select box listing anchors in text git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@94198 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
dc76a95357
commit
d99445c01b
@ -109,6 +109,17 @@ WidgetAreaEditorClass.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
addWidget: function(className, holder) {
|
addWidget: function(className, holder) {
|
||||||
|
|
||||||
|
if ($('WidgetAreaEditor-'+holder).getAttribute('maxwidgets')) {
|
||||||
|
var maxCount = $('WidgetAreaEditor-'+holder).getAttribute('maxwidgets');
|
||||||
|
var count = $$('#usedWidgets-'+holder+' .Widget').length;
|
||||||
|
if (count > maxCount) {
|
||||||
|
alert('Sorry, you have reached the maximum number of widgets in this area');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
this.name = holder;
|
this.name = holder;
|
||||||
new Ajax.Request('Widget_Controller/EditableSegment/' + className, {
|
new Ajax.Request('Widget_Controller/EditableSegment/' + className, {
|
||||||
onSuccess : $('usedWidgets-'+holder).parentNode.parentNode.insertWidgetEditor.bind(this)
|
onSuccess : $('usedWidgets-'+holder).parentNode.parentNode.insertWidgetEditor.bind(this)
|
||||||
@ -164,7 +175,7 @@ WidgetAreaEditorClass.prototype = {
|
|||||||
WidgetTreeDropdownField.applyTo('div.usedWidgets .TreeDropdownField');
|
WidgetTreeDropdownField.applyTo('div.usedWidgets .TreeDropdownField');
|
||||||
|
|
||||||
|
|
||||||
Sortable.create('usedWidgets-SideBar', {
|
Sortable.create('usedWidgets-'+this.name, {
|
||||||
tag: 'div',
|
tag: 'div',
|
||||||
handle: 'handle',
|
handle: 'handle',
|
||||||
containment: ['availableWidgets-'+this.name, 'usedWidgets-'+this.name],
|
containment: ['availableWidgets-'+this.name, 'usedWidgets-'+this.name],
|
||||||
|
Loading…
Reference in New Issue
Block a user