-
Notifications
You must be signed in to change notification settings - Fork 90
Add pfDataToolbar directive with ngDocs/Example and Unit Tests #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
}, | ||
link: function (scope, element, attrs) { | ||
scope.$watch('config', function () { | ||
if (scope.config && scope.config.viewsConfig && scope.config.viewsConfig.views) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be moved to the controller?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, watching and observing have to be done post compile (ie in the link function)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought we could 'watch' in controller:, and 'observe' in the link:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've always kept them in the link.
On Fri, Sep 4, 2015 at 1:53 PM, Dave Taylor notifications@github.com
wrote:
In src/views/toolbar/data-toolbar-directive.js
#71 (comment)
:
if ($scope.config.viewsConfig.onViewSelect && !$scope.checkViewDisabled(viewId)) {
$scope.config.viewsConfig.onViewSelect(viewId);
}
};
$scope.isViewSelected = function (viewId) {
return $scope.config.viewsConfig && ($scope.config.viewsConfig.currentView === viewId);
};
$scope.checkViewDisabled = function (view) {
return $scope.config.viewsConfig.checkViewDisabled && $scope.config.viewsConfig.checkViewDisabled(view);
};
},
link: function (scope, element, attrs) {
scope.$watch('config', function () {
if (scope.config && scope.config.viewsConfig && scope.config.viewsConfig.views) {
Thought we could 'watch' in controller:, and 'observe' in the link:
—
Reply to this email directly or view it on GitHub
https://github.com/patternfly/angular-patternfly/pull/71/files#r38777089
.
@dtaylor113 Yeah, this is only in the example though. It's fine when used in an application. I just couldn't get the right demo.css settings to fix it here. |
Weird list item stacking when selecting between "Birth Month" and "Name". The input box to the right of the pf-selector momentarily appears vertically stacked before collapsing into the single placeholder. Is this just in the demo? |
Yes, again it's in the example only. |
</file> | ||
</example> | ||
*/ | ||
angular.module('patternfly.views').directive('pfDataToolbar', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think a 'toolbar' should be under 'views', I know it consumes the 'views' mechanism, but it should probably go into a general 'components' directive. For now it's fine.
LGTM |
@waldenraines Do you have a moment to review this? |
Add pfDataToolbar directive with ngDocs/Example and Unit Tests
@jeff-phillips-18 I do but too late 😦 |
No description provided.