mirror of https://github.com/rancher/ui.git
Tweaks
This commit is contained in:
parent
64d8889976
commit
e805ef7355
|
|
@ -101,6 +101,7 @@ export default Ember.Route.extend({
|
|||
|
||||
function filter(data, category, catalogIds) {
|
||||
data = data.filterBy('templateBase', (templateBase === 'cattle' ? '' : templateBase));
|
||||
let categories = uniqKeys(data, 'category');
|
||||
|
||||
if ( category !== 'all' ) {
|
||||
data = data.filterBy('category', category);
|
||||
|
|
@ -109,7 +110,7 @@ export default Ember.Route.extend({
|
|||
data = data.sortBy('name');
|
||||
|
||||
return Ember.Object.create({
|
||||
categories: uniqKeys(data, 'category'),
|
||||
categories: categories,
|
||||
uniqueCatalogIds: catalogIds,
|
||||
catalog: data,
|
||||
templateBase: templateBase,
|
||||
|
|
|
|||
|
|
@ -79,15 +79,15 @@ export default Ember.Component.extend({
|
|||
bootstrapCatalogs: function() {
|
||||
let defaultCatalogs = [];
|
||||
let customCatalogs = [];
|
||||
let catalogUrls = this.get('settings').get(C.SETTING.CATALOG_URL).split(',');
|
||||
let catalogUrls = (this.get('settings').get(C.SETTING.CATALOG_URL)||'').split(',');
|
||||
|
||||
catalogUrls.forEach((catalog) => {
|
||||
let tmp = {};
|
||||
catalog = catalog.split('=')[0];
|
||||
|
||||
if (catalog === 'library' || catalog === 'community') {
|
||||
if (catalog === C.CATALOG.LIBRARY_KEY || catalog === C.CATALOG.COMMUNITY_KEY) {
|
||||
|
||||
if (catalog === 'library') {
|
||||
if (catalog === C.CATALOG.LIBRARY_KEY) {
|
||||
|
||||
if (this.get('settings.isPrivateLabel')) {
|
||||
tmp.icon = 'icon-catalog';
|
||||
|
|
|
|||
|
|
@ -1,32 +0,0 @@
|
|||
import Ember from 'ember';
|
||||
|
||||
const { getOwner } = Ember;
|
||||
|
||||
/*
|
||||
* Many link-to and resource-action-menus components on the screen are pretty slow.
|
||||
* So instead a static <a> and <button> are put in the template and this handles the clicks.
|
||||
*/
|
||||
export default Ember.Mixin.create({
|
||||
needs : ['application'],
|
||||
resourceActions : Ember.inject.service('resource-actions'),
|
||||
currentPath : Ember.computed.alias('application.currentPath'),
|
||||
|
||||
pathObserver: Ember.observer('currentPath', function() {
|
||||
// Make sure that when we change paths, close the action menu
|
||||
Ember.$('body').trigger('click');
|
||||
}),
|
||||
|
||||
click(event) {
|
||||
var btn = $(event.target).closest('BUTTON');
|
||||
if ( btn && btn.hasClass('more-actions') ) // Only menu buttons
|
||||
{
|
||||
this.get('resourceActions').show(this.get('model'), btn);
|
||||
}
|
||||
else if ( event.target.tagName === 'A' && $(event.target).data('transitionLink')) // Only links with data-transition-link
|
||||
{
|
||||
getOwner(this).lookup('router:main').transitionTo(event.target.pathname);
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
Loading…
Reference in New Issue