角树控制不突出整个细胞

时间:2016-10-14 09:42:22

标签: css angularjs css3

我试图从http://wix.github.io/angular-tree-control实现角度树控制,但是,我无法突出显示整个单元格,它只突出显示标签。我试图改变treecontrol附带的css,但我仍然不能突出整个单元格。

当前和预期的结果如下:

enter image description here

treecontrol {
    font-family: Verdana, Helvetica, Arial, sans-serif;
    font-size:13px;
    color: #555;
    text-decoration: none;
}
treecontrol ul {
    margin: 0;
    padding: 0;
    list-style: none;
    border: none;
    overflow: hidden;
}
treecontrol li {
    position: relative;
    padding: 0 0 0 20px;
    line-height: 20px;
    ul {
      padding-left: 16px;
    }
    .tree-label {
      cursor: pointer;
      display: inline;
      &:focus {
        outline: none;
      }
      &:hover {
        outline: none;
        background-color: yellow;
      }
    }
    .tree-selected {
      background-color: yellow;
    }
    &.tree-expanded {
      > div {
        > .tree-icon-expand {
          display: none;
        }
        > .tree-icon-collapse {
          display: inline;
        }
      }
    }
 }

treecontrol li.tree-expanded i.tree-leaf-head, treecontrol li.tree-collapsed i.tree-leaf-head {display:none;}
treecontrol li.tree-expanded i.tree-branch-head, treecontrol li.tree-collapsed i.tree-branch-head {display:inline;}
treecontrol li.tree-leaf i.tree-branch-head {display:none;}
treecontrol li.tree-leaf i.tree-leaf-head {display:inline;}

treecontrol li i.tree-branch-head {
  cursor: pointer;
}

treecontrol li.tree-expanded i.tree-branch-head {
  padding: 1px 10px;
  background: url("../images/node-opened-light.png") no-repeat;
}

treecontrol li.tree-collapsed i.tree-branch-head {
  padding: 1px 10px;
  background: url("../images/node-closed-light.png") no-repeat;
}

treecontrol li.tree-leaf i.tree-leaf-head {
  padding: 1px 10px;
  width: 16px; height: 16px;
  background: none no-repeat;
}

1 个答案:

答案 0 :(得分:4)

您在链接的同一页面中有一个示例

custom css classes

你的javascript就是

 function CustomCss($scope) {
     $scope.treedata=createSubTree(3, 4, "");
     $scope.opts = {
         injectClasses: {
             "liSelected": "c-liSelected",
         }
     };
 }

你的CSS

.c-liSelected {background-color: yellow}