vendredi 20 mars 2015

Liquid Fire Modal Odd Effect or Open/Close/Open?

I'm using liquid-fire to open a modal window in Ember.js. I have almost two identical sections – route, controller and template all extremely similar, but for some reason that I have not been able to debug, one section is producing a peculiar visual effect, almost as though the modal is opening, closing and then re-opening.


http://ift.tt/1I8a7HS http://ift.tt/1C7mh2T


Wondering if anyone has seen anything similar to this and might have any advice.


This is what the code looks like:


router.js:



Router.map(function() {
this.modal('show-modal', {withParams: ['show_id'], otherParams: 'show'});
this.resource('schedule', function () {});
});


application controller.js:



import Ember from "ember";
export default Ember.Controller.extend({
queryParams: ['show_id'],
show_id: null
});


schedule/index/controller.js:



import Ember from "ember";
export default Ember.Controller.extend({
needs: ['application'],
filteringByCategory: null,
init: function() {
var show_id = this.get('controllers.application').get('show_id');
if (show_id !== null) { this.setShow(show_id); }
this._super();
},
setShow: function (show_id) {
if (show_id !== null) {
var app = this.get('controllers.application');
var show = this.store.find('show', show_id);
app.set('show_id', show_id);
app.set('show', show);
}
return false;
},
actions: {
openShowModal: function (show_id) {
this.setShow(show_id);
return false;
}
}
});


schedule/index/route.js:



import Ember from 'ember';
export default Ember.Route.extend({
model: function () { return this.store.all('time_slot'); },
setupController: function (controller, model) {
controller.set('model', model);
}
});


schedule/index/template.hbs:



<div {{action 'openShowModal' slot.show_id}}>




Aucun commentaire:

Enregistrer un commentaire