From 483aaa329a0de823edfe6d1d3edc0933a58b8202 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 2 Oct 2012 17:19:16 +0200 Subject: [PATCH] Added .jsMarked for clipboard objects The object containing .jsClipboardItem should have the class .jsClipboardObject to support visual marking of elements (highlighting them). --- wcfsetup/install/files/js/WCF.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 7c204d4510..b5379f65eb 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -864,6 +864,9 @@ WCF.Clipboard = { var $item = $(item); if (WCF.inArray($item.data('objectID'), this._markedObjectIDs)) { $item.attr('checked', 'checked'); + + // add marked class for element container + $item.parents('.jsClipboardObject').addClass('jsMarked'); } }, this)); @@ -897,6 +900,7 @@ WCF.Clipboard = { var $container = $(container); $container.find('input.jsClipboardItem, input.jsClipboardMarkAll').removeAttr('checked'); + $container.find('.jsClipboardObject').removeClass('jsMarked'); }); }, @@ -930,9 +934,11 @@ WCF.Clipboard = { if ($isMarked) { this._markedObjectIDs.push($objectID); + $item.parents('.jsClipboardObject').addClass('jsMarked'); } else { this._markedObjectIDs = $.removeArrayValue(this._markedObjectIDs, $objectID); + $item.parents('.jsClipboardObject').removeClass('jsMarked'); } // item is part of a container @@ -1006,6 +1012,13 @@ WCF.Clipboard = { } } }, this)); + + if ($isMarked) { + $container.find('.jsClipboardObject').addClass('jsMarked'); + } + else { + $container.find('.jsClipboardObject').removeClass('jsMarked'); + } } // save new status -- 2.20.1