From 4a0b644f616c096a87a1de2e697e5af9af8b1c4d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 4 Dec 2018 10:19:24 +0300 Subject: [PATCH] Headlines.onRowChecked: fix possible desync in checkbox and row selected state --- js/Headlines.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/js/Headlines.js b/js/Headlines.js index fbe1bd98a..ad1d8f749 100755 --- a/js/Headlines.js +++ b/js/Headlines.js @@ -753,10 +753,19 @@ define(["dojo/_base/declare"], function (declare) { return rv; }, onRowChecked: function (elem) { - // account for dojo checkboxes - elem = elem.domNode || elem; + // do not allow unchecking active article checkbox + if (row.hasClassName("active")) { + elem.attr("checked", 1); + return; + } - elem.up("div[id*=RROW]").toggleClassName("Selected"); + const row = elem.domNode.up("div[id*=RROW]"); + + if (elem.attr("checked")) { + row.addClassName("Selected"); + } else { + row.removeClassName("Selected"); + } this.updateSelectedPrompt(); },