panel rows adjust to span the number of visible columns

This commit is contained in:
Rob Harrington
2015-06-08 12:05:04 +08:00
parent c441c8c6cb
commit 451ba1c01b
2 changed files with 6 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
angular.module("admin.indexUtils").directive "panelRow", (Panels) ->
angular.module("admin.indexUtils").directive "panelRow", (Panels, Columns) ->
restrict: "C"
templateUrl: "admin/panel.html"
scope:
@@ -7,6 +7,10 @@ angular.module("admin.indexUtils").directive "panelRow", (Panels) ->
link: (scope, element, attrs) ->
scope.template = ""
selected = null
scope.columnCount = Columns.visibleCount
scope.$on "columnCount:changed", (event, count) ->
scope.columnCount = count
setTemplate = ->
if selected?

View File

@@ -1,2 +1,2 @@
%td{ colspan: 4 }
%td{ colspan: "{{columnCount}}" }
.panel{ ng: { include: "template" } }