Added CSS for ACL and fixed WCF.Search.Base
authorAlexander Ebert <ebert@woltlab.com>
Wed, 4 Apr 2012 14:47:39 +0000 (16:47 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 4 Apr 2012 14:47:39 +0000 (16:47 +0200)
wcfsetup/install/files/js/WCF.js
wcfsetup/install/files/style/acl.less [new file with mode: 0644]
wcfsetup/install/files/style/bootstrap.less

index 96be903a56ce0f4fe42561c804ea3176d1a3cfb7..e4b4efa63a80182232502505e76bf8c06849fb91 100644 (file)
@@ -3864,8 +3864,8 @@ WCF.Search.Base = Class.extend({
                        this._excludedSearchValues = excludedSearchValues;
                }
                this._searchInput = $(searchInput).keyup($.proxy(this._keyUp, this));
-               this._searchInput.wrap('<span />');
-               this._list = $('<ul class="wcf-dropdown" />').insertAfter(this._searchInput);
+               this._searchInput.wrap('<span class="dropdown" />');
+               this._list = $('<ul class="dropdownMenu" />').insertAfter(this._searchInput);
                
                this._proxy = new WCF.Action.Proxy({
                        success: $.proxy(this._success, this)
@@ -3919,13 +3919,12 @@ WCF.Search.Base = Class.extend({
         * @param       jQuery          jqXHR
         */
        _success: function(data, textStatus, jqXHR) {
+               this._clearList(false);
+               
+               // no items available, abort
                if (!$.getLength(data.returnValues)) {
-                       this._clearList(false);
-
                        return;
                }
-
-               this._clearList(false);
                
                for (var $i in data.returnValues) {
                        var $item = data.returnValues[$i];
@@ -3933,7 +3932,9 @@ WCF.Search.Base = Class.extend({
                        this._createListItem($item);
                }
                
-               this._list.addClass('open');
+               this._list.parent().addClass('dropdownOpen');
+               
+               WCF.CloseOverlayHandler.addCallback('WCF.Search.Base', $.proxy(function() { this._clearList(true) }, this));
        },
        
        /**
@@ -3974,7 +3975,9 @@ WCF.Search.Base = Class.extend({
                        this._searchInput.val('');
                }
 
-               this._list.removeClass('open').empty();
+               this._list.parent().removeClass('dropdownOpen').end().empty();
+               
+               WCF.CloseOverlayHandler.removeCallback('WCF.Search.Base');
        },
        
        /**
@@ -4043,7 +4046,7 @@ WCF.Search.User = WCF.Search.Base.extend({
                var $listItem = this._super(item);
                
                // insert item type
-               $('<img src="' + WCF.Icon.get('wcf.icon.user' + (item.type == 'group' ? 's' : '')) + '" alt="" />').insertBefore($listItem.children('span:eq(0)'));
+               $('<img src="' + WCF.Icon.get('wcf.icon.user' + (item.type == 'group' ? 's' : '')) + '" alt="" class="icon16" style="margin-right: 4px;" />').prependTo($listItem.children('span:eq(0)'));
                $listItem.data('type', item.type);
                
                return $listItem;
diff --git a/wcfsetup/install/files/style/acl.less b/wcfsetup/install/files/style/acl.less
new file mode 100644 (file)
index 0000000..3142161
--- /dev/null
@@ -0,0 +1,75 @@
+.aclContainer dd > span {
+       position: relative;
+}
+
+.aclList,
+.aclPermissionList {
+       margin-top: 0;
+       min-height: 100px;
+
+       li {
+               display: block;
+               padding: @wcfGapTiny;
+
+               &:first-child {
+                       border-top-left-radius: @wcfContainerBorderRadius;
+                       border-top-right-radius: @wcfContainerBorderRadius;
+               }
+               
+               &:last-child {
+                       border-bottom-left-radius: @wcfContainerBorderRadius;
+                       border-bottom-right-radius: @wcfContainerBorderRadius;
+               }
+       }
+}
+
+.aclList {
+       margin-bottom: @wcfGapSmall;
+       
+       li {
+               cursor: pointer;
+
+               &:hover,
+               &.active:hover {
+                       background-color: @wcfHoverBackgroundColor;
+               }
+               
+               &.active {
+                       background-color: @wcfContainerAccentBackgroundColor;
+               }
+               
+               img:last-child {
+                       float: right;
+                       margin-right: @wcfGapSmall;
+               }
+       }
+}
+
+.aclPermissionList {
+       margin-top: @wcfGapSmall;
+       min-height: 200px;
+       text-align: right;
+
+       li {
+               &:hover {
+                       background-color: @wcfHoverBackgroundColor;
+               }
+               
+               &.aclCategory {
+                       background-color: @wcfHighlightBackgroundColor;
+                       padding: @wcfGapSmall;
+                       text-align: left;
+               }
+               
+               span {
+                       float: left;
+                       padding-left: @wcfGapSmall;
+               }
+               
+               label {
+                       cursor: pointer;
+                       margin: 0 @wcfGapSmall;
+                       padding: 0 @wcfGapLarge;
+               }
+       }
+}
\ No newline at end of file
index f162f3d18c42a4a01616f2f08b9dea496bed0896..d8b49944f2284cbb14e840e1b70aa5400347fc6f 100644 (file)
@@ -34,6 +34,7 @@
 @import "dialog.less";
 @import "tooltip.less";
 @import "notification.less";
+@import "acl.less";
 
 /* application */
 @import "wbb.less";
\ No newline at end of file