This commit is contained in:
Leo Horie 2015-04-13 08:29:03 -04:00
parent 9e558c199c
commit 2923104d27
6 changed files with 124 additions and 5 deletions

View file

@ -254,10 +254,10 @@ var m = (function app(window, undefined) {
if (!data.attrs) data.attrs = {};
if (!cached.attrs) cached.attrs = {};
var dataAttrKeys = Object.keys(data.attrs)
var dataAttrKeys = Object.getOwnPropertyNames(data.attrs)
var hasKeys = dataAttrKeys.length > ("key" in data.attrs ? 1 : 0)
//if an element is different enough from the one in cache, recreate it
if (data.tag != cached.tag || dataAttrKeys.join() != Object.keys(cached.attrs).join() || data.attrs.id != cached.attrs.id || data.attrs.key != cached.attrs.key || (m.redraw.strategy() == "all" && cached.configContext && cached.configContext.retain !== true) || (m.redraw.strategy() == "diff" && cached.configContext && cached.configContext.retain === false)) {
if (data.tag != cached.tag || dataAttrKeys.join() != Object.getOwnPropertyNames(cached.attrs).join() || data.attrs.id != cached.attrs.id || data.attrs.key != cached.attrs.key || (m.redraw.strategy() == "all" && cached.configContext && cached.configContext.retain !== true) || (m.redraw.strategy() == "diff" && cached.configContext && cached.configContext.retain === false)) {
if (cached.nodes.length) clear(cached.nodes);
if (cached.configContext && typeof cached.configContext.onunload === FUNCTION) cached.configContext.onunload()
if (cached.controllers) {
@ -746,7 +746,7 @@ var m = (function app(window, undefined) {
// Get all routes and check if there's
// an exact match for the current path
var keys = Object.keys(router);
var keys = Object.getOwnPropertyNames(router);
var index = keys.indexOf(path);
if(index !== -1){
m.mount(root, router[keys [index]]);