javascript - Liquid Fire Modal Odd Effect or Open/Close/Open? -
i'm using liquid-fire open modal window in ember.js. have 2 identical sections – route, controller , template extremely similar, reason have not been able debug, 1 section producing peculiar visual effect, though modal opening, closing , re-opening.
http://staging.ckdu.ca/shows http://staging.ckdu.ca/schedule
wondering if has seen similar , might have advice.
this 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 "ember"; export default ember.controller.extend({ queryparams: ['show_id'], show_id: null });
schedule/index/controller.js:
import ember "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 '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}}>
transitions.js:
export default function() { var duration = 100; this.transition( this.use('fade', {duration: duration}), this.reverse('fade', {duration: duration}) ); this.transition( this.fromroute('shows.index'), this.toroute('shows.show'), this.use('scrollthen', 'toleft', {duration: duration}), this.reverse('scrollthen', 'toright') ); }
figured out ember observe returns callback twice when used query params.
the salient point ember query params, according stack overflow answer above, converted strings.
my shows section accessing show model, , model using default id attribute, schedule section using timeslot model, had attribute show ids had set manually ds.attr('number').
so schedule section, setting query param, changed once – , liquid-fire observed change , started process – , queryparam converted string, changed second time – , liquid-fire observed change well, , interrupted itself, etc.
at rate, @runspired this.
Comments
Post a Comment