File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -236,12 +236,21 @@ sub script {
236236 element.innerHTML = null;
237237 var check = document.createElement('input');
238238 check.type = 'checkbox';
239- check.checked = true;
240- sheet.addRule('pre.' + className, '');
241- var rule = sheet.rules[sheet.rules.length - 1];
242- check.onchange = function (e) {
243- rule.style.display = this.checked ? 'block' : 'none';
239+ if (className == 'open') {
240+ check.checked = false;
241+ sheet.insertRule('pre:not(.open)' + '{}', sheet.cssRules.length);
242+ check.onchange = function (e) {
243+ rule.style.display = this.checked ? 'none' : 'block';
244+ }
244245 }
246+ else {
247+ check.checked = true;
248+ sheet.insertRule('pre.' + className + '{}', sheet.cssRules.length);
249+ check.onchange = function (e) {
250+ rule.style.display = this.checked ? 'block' : 'none';
251+ }
252+ }
253+ var rule = sheet.cssRules[sheet.cssRules.length - 1];
245254 element.appendChild(check);
246255 element.appendChild(span);
247256 }
You can’t perform that action at this time.
0 commit comments