Added .jsMarked for clipboard objects
authorAlexander Ebert <ebert@woltlab.com>
Tue, 2 Oct 2012 15:19:16 +0000 (17:19 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 2 Oct 2012 15:19:16 +0000 (17:19 +0200)
The object containing .jsClipboardItem should have the class .jsClipboardObject to support visual marking of elements (highlighting them).

wcfsetup/install/files/js/WCF.js

index 7c204d4510f0086a43430f713896a5910d1d8931..b5379f65ebebb600ae3ab2c226eefb75ff9d8254 100755 (executable)
@@ -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