mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
elofgren: USABILITY: In 'Page Version History' left sidebar section, use a checkbox labeled 'Compare mode (click 2 below)' instead of a drop-down with only 'View (click to see)' and 'Compare (click 2 to see)' options. More info: http://www.elijahlofgren.com/silverstripe/inconsistent-go-buttons/
(merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@41845 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
d497fbf671
commit
e70d060983
@ -308,13 +308,14 @@ VersionAction = Class.create();
|
||||
VersionAction.prototype = {
|
||||
initialize: function() {
|
||||
this.holder = $('versions_holder');
|
||||
this.selector = this.getElementsByTagName('select')[0];
|
||||
this.selector.holder = this;
|
||||
this.selector.onchange = function() { this.holder.changed(this.value,this); return false; }
|
||||
|
||||
this.showallCheckbox = $('versions_showall');
|
||||
this.showallCheckbox.holder = this;
|
||||
this.showallCheckbox.onclick = this.showall_change;
|
||||
|
||||
this.comparemodeCheckbox = $('versions_comparemode');
|
||||
this.comparemodeCheckbox.holder = this;
|
||||
this.comparemodeCheckbox.onclick = function() { this.holder.comparemode_change(this.checked); }
|
||||
},
|
||||
|
||||
showall_change: function() {
|
||||
@ -322,26 +323,26 @@ VersionAction.prototype = {
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
if(this.selector) {
|
||||
this.selector.holder = null;
|
||||
this.selector.onchange = null;
|
||||
if(this.comparemodeCheckbox) {
|
||||
this.comparemodeCheckbox.holder = null;
|
||||
this.comparemodeCheckbox.onclick = null;
|
||||
}
|
||||
if(this.showallCheckbox) {
|
||||
this.showallCheckbox.holder = null;
|
||||
this.showallCheckbox.onchange = null;
|
||||
}
|
||||
this.holder = null;
|
||||
this.selector = null;
|
||||
this.comparemodeCheckbox = null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Handler function whenever an action is clicked
|
||||
* Handler function when comparemode checkbox is clicked
|
||||
*/
|
||||
changed: function(url, selector) {
|
||||
switch(url) {
|
||||
case 'view': return this.view();
|
||||
case 'compare': return this.compare();
|
||||
default: errorMessage("VersionAction.changed: I don't know about action '" + url + "'");
|
||||
comparemode_change: function(isChecked) {
|
||||
if (true == isChecked) {
|
||||
return this.compare();
|
||||
} else {
|
||||
return this.view();
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -103,10 +103,7 @@
|
||||
</h2>
|
||||
<div class="listpane" id="versions_holder" style="display:none">
|
||||
<p class="pane_actions" id="versions_actions">
|
||||
<select>
|
||||
<option value="view" selected="selected">View (click to see)</option>
|
||||
<option value="compare" >Compare (click 2 to see)</option>
|
||||
</select>
|
||||
<input type="checkbox" id="versions_comparemode" /> Compare mode (click 2 below)
|
||||
<br />
|
||||
|
||||
<input type="checkbox" id="versions_showall" /> Show unpublished versions
|
||||
|
Loading…
Reference in New Issue
Block a user