Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save deividkamui/033b6adc407c4f291d173368d25e8723 to your computer and use it in GitHub Desktop.
Save deividkamui/033b6adc407c4f291d173368d25e8723 to your computer and use it in GitHub Desktop.
import Ember from 'ember';
export default Ember.Component.extend({
info: null,
ready: false,
ajaxCall: null,
didInsertElement: function () {
this.queryData();
},
didUpdateAttrs: function () {
this._super(...arguments);
this.queryData();
},
queryData: function () {
/**Ember.$.post() **/
},
willDestroy: function () {
this.ajaxCall.abort();
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
actions: {
showDescription: function (params) {
this.set('model.selectedModule', params);
}
}
});
import Ember from 'ember';
export default Ember.Route.extend({
selectedModule: '',
model: function () {
return {
selectedModule: 'employeeModule'
};
},
actions: {
showDescription: function (params) {
this.set('model.selectedModule', params);
}
}
});
<div class="row">
<div class="col-md-6 col-xs-12 col-sm-6">
<div id="employeesCard" class="row mCard mHovered" {{action "showDescription" "employeeModule" on="mouseEnter"}}>
<div class="col-md-12 mButtonType">
<div class="row header">
<h1>Employees</h1>
</div>
{{#link-to 'new.employee' class="mRoundButton"}} <i class="fa fa-2x fa-plus" aria-hidden="true"></i> {{/link-to}}
</div>
</div>
<br>
<div id="supervisorCard" class="row mCard mHovered" {{action "showDescription" "supervisorsModule" on="mouseEnter"}}>
<div class="col-md-12 mButtonType">
<div class="row header">
<h1>Supervisors</h1>
</div>
{{#link-to 'new.supervisors' class="mRoundButton"}} <i class="fa fa-2x fa-plus" aria-hidden="true"></i> {{/link-to}}
</div>
</div>
</div>
<div id="descriptionArea" class="col-md-6 col-xs-6 col-sm-6 top-separator">
{{sis-db-description-render idTitle=model.selectedModule}}
</div>
</div>
{{outlet}}
{{#if ready}}
{{#if info}}
{{{info}}}
{{/if}}
{{else}}
{{#sis-indicator-loading}}Información{{/sis-indicator-loading}}
{{/if}}
{{yield}}
{
"version": "0.11.0",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.10.2",
"ember-data": "2.11.0",
"ember-template-compiler": "2.10.2",
"ember-testing": "2.10.2"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment