mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-22 16:18:10 +00:00
Add nav-link component template and component script for bootstrap nav link
This commit is contained in:
parent
297f2b89fc
commit
0022d192d0
20
wherehows-web/app/components/nav-link.js
Normal file
20
wherehows-web/app/components/nav-link.js
Normal file
@ -0,0 +1,20 @@
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.LinkComponent.extend({
|
||||
tagName: 'li',
|
||||
|
||||
attributeBindings: ['data-toggle', 'data-target'],
|
||||
|
||||
hrefForA: Ember.computed('models', 'qualifiedRouteName', function () {
|
||||
let qualifiedRouteName = this.get('qualifiedRouteName');
|
||||
let models = this.get('models');
|
||||
|
||||
if (this.get('loading')) {
|
||||
return this.get('loadingHref');
|
||||
}
|
||||
|
||||
let routing = this.get('_routing');
|
||||
let queryParams = this.get('queryParams.values');
|
||||
return routing.generateURL(qualifiedRouteName, models, queryParams);
|
||||
})
|
||||
});
|
1
wherehows-web/app/templates/components/nav-link.hbs
Normal file
1
wherehows-web/app/templates/components/nav-link.hbs
Normal file
@ -0,0 +1 @@
|
||||
<a href="{{hrefForA}}">{{yield}}</a>
|
Loading…
x
Reference in New Issue
Block a user