GithubHelp home page GithubHelp logo

jamesplease / marionette.transition-region Goto Github PK

View Code? Open in Web Editor NEW
52.0 52.0 11.0 268 KB

(Unsupported) Because animated view transitions should be easy.

License: MIT License

CSS 5.09% JavaScript 85.31% HTML 9.59%

marionette.transition-region's People

Contributors

jamesplease avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

marionette.transition-region's Issues

Marionette v2

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?

Update behavior of queue

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.

Prepare the library for an alpha release

Let's move this project beyond prototype status and get it ready for an alpha release.

  • Clean up the code
  • Add unit tests
  • Add unit tests against Marionette's tests to ensure BC

๐Ÿ‘ฏ

Uncaught TypeError: undefined is not a function (Line:75)

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();  

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.