jamesplease / marionette.transition-region Goto Github PK
View Code? Open in Web Editor NEW(Unsupported) Because animated view transitions should be easy.
License: MIT License
(Unsupported) Because animated view transitions should be easy.
License: MIT License
To ensure BC.
Hi James, I'm wondering if it's ok to update this to work with Marionette version 2 .. or has this been superseded by version 2?
Yup
The queue works fine right now, but not great.
Presently, if a region is showing ViewA, and you request it to show ViewB, it will always complete this transition. ViewB will be shown no matter what. This only matters in instances when a user hastily selects a new view to show, say, ViewC, before that transition is over.
To elaborate, the way that the queue is currently implemented is that ViewA will continue to slide out, then ViewB will slide in. After this, ViewB will slide out, and ViewC slides in.
If the user is even hastier, and they manage to click ViewD before ViewC ever begins to slide in, then the transition to ViewC is skipped completely. It goes straight from B to D.
What would be really great is if the behavior allowed the user to conceivably skip ViewB if they change their mind fast enough. If the user selects C, and then D, before A is even transitioned...then C should never show! It should go right to D. But, again, it always shows C with the current behavior.
This is a note for me to fix this.
The solution involves always using the queue for the animateIn behavior instead of relying on the arguments being passed into the original show
call. It should be a quick fix actually.
Let's move this project beyond prototype status and get it ready for an alpha release.
๐ฏ
Here is the stack trace from Chrome:
Uncaught TypeError: undefined is not a function marionette.transition-region.js:75
Marionette.TransitionRegion.Marionette.Region.extend.show marionette.transition-region.js:75
Module.Controller.Marionette.Controller.extend.index index.js:55
Backbone.Router.extend.index router.js:39
(anonymous function) backbone.routefilter.js:91
_.extend.execute backbone.js:1265
(anonymous function) backbone.js:1254
(anonymous function) backbone.js:1481
_.some._.any underscore.js:208
_.extend.loadUrl backbone.js:1479
_.extend.start backbone.js:1445
(anonymous function) app.js:77
triggerEvents backbone.js:207
Backbone.Events.trigger backbone.js:148
Marionette.triggerMethod.triggerMethod backbone.marionette.js:604
_.extend.start backbone.marionette.js:2581
(anonymous function) main.js:20fire jquery.js:3119
self.add jquery.js:3165
jQuery.fn.ready jquery.js:3399
jQuery.fn.init jquery.js:2839
jQuery jquery.js:73
startApp main.js:11
getLocaleAndStartApp main.js:52
(anonymous function) main.js:89
(anonymous function) main.js:77
app.js and main.js are my code and here is what app.js is doing (relevant code only):
AppLayout = Backbone.Marionette.Layout.extend({
regions: {
header: 'header',
content: new Backbone.Marionette.TransitionRegion({ el: '#content' }),//'#content',
footer: 'footer',
},
});
NOTE: If I replace "new Backbone.Marionette.TransitionRegion({ el: '#content' })" with "'#content'" , then everything works fine.
Also, line 77 in app.js is:
Backbone.history.start();
I am trying to install the script using bower but I don't think it is registered with bower yet.
Yup
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.