From bbef7b6b4c244bf415138a13838806c4ebb1761a Mon Sep 17 00:00:00 2001 From: Alex Nicksay Date: Mon, 2 Mar 2015 01:51:06 -0500 Subject: [PATCH] Enable animation based on page transitions. Responses can now send a `name` value which will be used to construct "from" and "to" CSS classes that will be applied during updates. These two classes will be applied with the following patterns: * `config['animation-class'] + '-from-' + _previous_name_` * `config['animation-class'] + '-to-' + _current_name_` This will allow transitions to be applied based on state of the page (i.e. navigating from page A to page B) instead of based on the action (i.e. navigating back in the history stack). Progress on #299. --- src/client/base.js | 9 ++++-- src/client/dom/classlist.js | 32 +++++++++++--------- src/client/nav/nav.js | 10 +++++++ src/client/nav/response.js | 17 ++++++++++- src/server/demo/app.py | 6 ++++ src/server/demo/static/app.css | 37 +++++++++++++++++++----- src/server/demo/templates/base.tmpl | 2 +- src/server/demo/templates/chunked.tmpl | 1 + src/server/demo/templates/demo.tmpl | 1 + src/server/demo/templates/index.tmpl | 1 + src/server/demo/templates/missing.tmpl | 1 + src/server/demo/templates/other.tmpl | 1 + src/server/demo/templates/spec.tmpl | 1 + src/server/demo/templates/truncated.tmpl | 1 + src/server/python/spf.py | 1 + 15 files changed, 95 insertions(+), 26 deletions(-) diff --git a/src/client/base.js b/src/client/base.js index 2ede96a2..db51ea5e 100644 --- a/src/client/base.js +++ b/src/client/base.js @@ -146,19 +146,21 @@ spf.EventName = { /** * Type definition for a single SPF response object. * - attr: Map of Element IDs to maps of attibute names to attribute values - * to set on the Elements. + * to set on the Elements. * - body: Map of Element IDs to HTML strings containing content with which - * to update the Elements. + * to update the Elements. * - cacheKey: Key used to cache this response. * - cacheType: String of the type of caching to use for this response. * - foot: HTML string containing