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:
Ingo Schommer 2007-09-15 00:48:48 +00:00
parent d497fbf671
commit e70d060983
2 changed files with 15 additions and 17 deletions

View File

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

View File

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