summaryrefslogtreecommitdiff
path: root/horizon
diff options
context:
space:
mode:
authorThai Tran <tqtran@us.ibm.com>2015-03-24 16:27:45 -0700
committerKelly Domico <kelly.domico@hp.com>2015-04-03 02:49:16 +0000
commitd5a5ea6ca8e67c32f824fa4d512c3405b23c90b9 (patch)
tree49312a00c738f6efe5c19532087ac6d23fbc0915 /horizon
parent129644ecaffdc7c1828231eba4071ba7bb48e317 (diff)
downloadhorizon-d5a5ea6ca8e67c32f824fa4d512c3405b23c90b9.tar.gz
Adding transclude to search-bar for batch actions
Currently, there is no good way to align the batch/table actions along with the search bar. The best way is to treat each element in the row as a table-cell. To achieve this, we transclude the search bar so that it is possible to embed additional actions. Co-Authored-By: Kelly Domico <kelly.domico@hp.com> Closes-bug: #1436107 Change-Id: I47905601e4ddf687d6554ff67eabaa3e6985f202
Diffstat (limited to 'horizon')
-rw-r--r--horizon/static/angular/table/basic-table.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/horizon/static/angular/table/basic-table.js b/horizon/static/angular/table/basic-table.js
index b3db3134f..0bf41a2f9 100644
--- a/horizon/static/angular/table/basic-table.js
+++ b/horizon/static/angular/table/basic-table.js
@@ -35,7 +35,8 @@
return {
restrict: 'E',
templateUrl: path + 'table/search-bar.html',
- link: function (scope, element, attrs) {
+ transclude: true,
+ link: function (scope, element, attrs, ctrl, transclude) {
if (angular.isDefined(attrs.groupClasses)) {
element.find('.input-group').addClass(attrs.groupClasses);
}
@@ -49,6 +50,10 @@
}
var placeholderText = attrs.placeholder || FILTER_PLACEHOLDER_TEXT;
searchInput.attr('placeholder', placeholderText);
+
+ transclude(scope, function(clone){
+ element.find('.input-group').append(clone);
+ });
}
};
}]);