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:
Ingo Schommer 2012-05-01 14:10:09 +02:00
parent feab46e075
commit 4c2352f908
2 changed files with 6 additions and 11 deletions

View File

@ -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.

View File

@ -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');
}
});
});