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 = {
|
VersionAction.prototype = {
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
this.holder = $('versions_holder');
|
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 = $('versions_showall');
|
||||||
this.showallCheckbox.holder = this;
|
this.showallCheckbox.holder = this;
|
||||||
this.showallCheckbox.onclick = this.showall_change;
|
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() {
|
showall_change: function() {
|
||||||
@ -322,26 +323,26 @@ VersionAction.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
if(this.selector) {
|
if(this.comparemodeCheckbox) {
|
||||||
this.selector.holder = null;
|
this.comparemodeCheckbox.holder = null;
|
||||||
this.selector.onchange = null;
|
this.comparemodeCheckbox.onclick = null;
|
||||||
}
|
}
|
||||||
if(this.showallCheckbox) {
|
if(this.showallCheckbox) {
|
||||||
this.showallCheckbox.holder = null;
|
this.showallCheckbox.holder = null;
|
||||||
this.showallCheckbox.onchange = null;
|
this.showallCheckbox.onchange = null;
|
||||||
}
|
}
|
||||||
this.holder = 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) {
|
comparemode_change: function(isChecked) {
|
||||||
switch(url) {
|
if (true == isChecked) {
|
||||||
case 'view': return this.view();
|
return this.compare();
|
||||||
case 'compare': return this.compare();
|
} else {
|
||||||
default: errorMessage("VersionAction.changed: I don't know about action '" + url + "'");
|
return this.view();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -103,10 +103,7 @@
|
|||||||
</h2>
|
</h2>
|
||||||
<div class="listpane" id="versions_holder" style="display:none">
|
<div class="listpane" id="versions_holder" style="display:none">
|
||||||
<p class="pane_actions" id="versions_actions">
|
<p class="pane_actions" id="versions_actions">
|
||||||
<select>
|
<input type="checkbox" id="versions_comparemode" /> Compare mode (click 2 below)
|
||||||
<option value="view" selected="selected">View (click to see)</option>
|
|
||||||
<option value="compare" >Compare (click 2 to see)</option>
|
|
||||||
</select>
|
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<input type="checkbox" id="versions_showall" /> Show unpublished versions
|
<input type="checkbox" id="versions_showall" /> Show unpublished versions
|
||||||
|
Loading…
Reference in New Issue
Block a user