mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Don't trigger on click on construction of view-model toggles, as it bubbles up to the panel, where it causes a toggle action which overrides any previous user choices stored in cookies (fixes #7210)
This commit is contained in:
parent
feab46e075
commit
4c2352f908
@ -63,14 +63,6 @@
|
||||
this._super();
|
||||
},
|
||||
|
||||
onclick: function(e) {
|
||||
// By default, the whole collapsed area serves as a trigger
|
||||
if(this.data('expandOnClick') && jQuery(this).hasClass('collapsed')) {
|
||||
e.preventDefault();
|
||||
this.expandPanel();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Boolean} TRUE to expand, FALSE to collapse.
|
||||
* @param {Boolean} TRUE means that events won't be fired, which is useful for the component initialization phase.
|
||||
|
@ -328,13 +328,16 @@
|
||||
$('.cms-tree-view-modes input.view-mode').entwine({
|
||||
onmatch: function() {
|
||||
// set active by default
|
||||
this.trigger('click');
|
||||
this.redraw();
|
||||
this._super();
|
||||
},
|
||||
onclick: function(e) {
|
||||
this.redraw();
|
||||
},
|
||||
redraw: function(type) {
|
||||
$('.cms-tree')
|
||||
.toggleClass('draggable', $(e.target).val() == 'draggable')
|
||||
.toggleClass('multiple', $(e.target).val() == 'multiselect');
|
||||
.toggleClass('draggable', this.val() == 'draggable')
|
||||
.toggleClass('multiple', this.val() == 'multiselect');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user