Skip to content
Snippets Groups Projects
Commit 55d0039f authored by Anika Henke's avatar Anika Henke
Browse files

disable multiple revisions checkboxes if two are checked

darcs-hash:20090117172920-f7d6d-d8a093a5b80a48b92c2f3abb08f7d029ae23e732.gz
parent 0256626a
No related branches found
No related tags found
No related merge requests found
......@@ -475,6 +475,32 @@ function cleanMsgArea(){
}
}
/**
* disable multiple revisions checkboxes if two are checked
*
* @author Anika Henke <anika@selfthinker.org>
*/
addInitEvent(function(){
var revForm = $('page__revisions');
if (!revForm) return;
var elems = revForm.elements;
var countTicks = 0;
for (var i=0; i<elems.length; i++) {
var input1 = elems[i];
if (input1.type=='checkbox') {
addEvent(input1,'click',function(e){
if (this.checked) countTicks++;
else countTicks--;
for (var j=0; j<elems.length; j++) {
var input2 = elems[j];
if (countTicks >= 2) input2.disabled = (input2.type=='checkbox' && !input2.checked);
else input2.disabled = (input2.type!='checkbox');
}
});
}
}
});
/**
* Add the event handler to the actiondropdown
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment