Skip to content
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

"Singleton"-Widgets #85

Closed
lukee910 opened this issue Apr 14, 2015 · 4 comments
Closed

"Singleton"-Widgets #85

lukee910 opened this issue Apr 14, 2015 · 4 comments
Assignees

Comments

@lukee910
Copy link

Would it be possible to create Widgets that only can be put on the Dashboard once? Or is that not in the sense of Widgets?

@sdorra sdorra self-assigned this Apr 16, 2015
@sdorra
Copy link
Member

sdorra commented Apr 16, 2015

This is not possible at the moment, but i will keep this is mind.

@lukee910
Copy link
Author

if (angular.isFunction(widgetFilter)){
  widgets = {};
  angular.forEach(dashboard.widgets, function(widget, type){
    if (widgetFilter(widget, type)){
      widgets[type] = widget;
    }
  });
} else {
  widgets = dashboard.widgets;
}

This code is at line 442 of angular-dashboard-framework.js. It fills the object widgets that is used in the addWidgetDialog, you'll be able to add every widget that is in that object.

Is there a way to set the widgetFilter function to check if it is in the model? This is in the adfDashboard directive, where you have access to the model.

@sdorra
Copy link
Member

sdorra commented Apr 30, 2015

The widget filter get now the model as third parameter. You should now be able to search, if a widget already exists in the model.

@lukee910
Copy link
Author

Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants