From 3a48f8dea93c4449c2ab0e181ad4bbf4a063b9d6 Mon Sep 17 00:00:00 2001 From: "konstantin.grabar" Date: Tue, 21 Feb 2012 20:11:16 +0400 Subject: [PATCH] [refs #193] Add lost file with wiki_history checkboxes script --- app/assets/javascripts/wiki_history.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 app/assets/javascripts/wiki_history.js diff --git a/app/assets/javascripts/wiki_history.js b/app/assets/javascripts/wiki_history.js new file mode 100644 index 000000000..50bf733e1 --- /dev/null +++ b/app/assets/javascripts/wiki_history.js @@ -0,0 +1,20 @@ +// Disable checkboxes selection for history table for more than 2 versions: +//$(document).ready(function() { + if ('.wiki .history') { + $('.niceCheck-main').click(function() { + var count = 0; + $('input.history_cbx').each(function(i,el) { + if ($(el).attr('checked')) { + count = count + 1; + } + }); + if (count > 2) { + var cbx = $( $(this).find('input.history_cbx')[0] ); + if ( cbx.attr('checked') ) { + $(this).css('background-position', '0pt 0px'); + cbx.removeAttr('checked'); + } + } + }); + } +//});