From: Alexander Ebert Date: Tue, 2 Oct 2012 15:19:16 +0000 (+0200) Subject: Added .jsMarked for clipboard objects X-Git-Tag: 2.0.0_Beta_1~897^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=483aaa329a0de823edfe6d1d3edc0933a58b8202;p=GitHub%2FWoltLab%2FWCF.git Added .jsMarked for clipboard objects The object containing .jsClipboardItem should have the class .jsClipboardObject to support visual marking of elements (highlighting them). --- 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