use less expensive check for attribute diff qualification
This commit is contained in:
parent
86ba3474a6
commit
bde67fa895
1 changed files with 2 additions and 3 deletions
|
|
@ -119,14 +119,14 @@ new function(window) {
|
||||||
function setAttributes(node, dataAttrs, cachedAttrs) {
|
function setAttributes(node, dataAttrs, cachedAttrs) {
|
||||||
for (var attrName in dataAttrs) {
|
for (var attrName in dataAttrs) {
|
||||||
var dataAttr = dataAttrs[attrName]
|
var dataAttr = dataAttrs[attrName]
|
||||||
//if (!(attrName in cachedAttrs) || (cachedAttrs[attrName] !== dataAttr)) {
|
if (!(attrName in cachedAttrs) || (cachedAttrs[attrName] !== dataAttr) || node === window.document.activeElement) {
|
||||||
cachedAttrs[attrName] = dataAttr
|
cachedAttrs[attrName] = dataAttr
|
||||||
if (attrName == "config") continue
|
if (attrName == "config") continue
|
||||||
if (attrName.indexOf("on") == 0 && typeof dataAttr == "function") dataAttr = autoredraw(dataAttr, node)
|
if (attrName.indexOf("on") == 0 && typeof dataAttr == "function") dataAttr = autoredraw(dataAttr, node)
|
||||||
if (attrName == "style") for (var rule in dataAttr) node.style[rule] = dataAttr[rule]
|
if (attrName == "style") for (var rule in dataAttr) node.style[rule] = dataAttr[rule]
|
||||||
else if (attrName in node) node[attrName] = dataAttr
|
else if (attrName in node) node[attrName] = dataAttr
|
||||||
else node.setAttribute(attrName, dataAttr)
|
else node.setAttribute(attrName, dataAttr)
|
||||||
//}
|
}
|
||||||
}
|
}
|
||||||
return cachedAttrs
|
return cachedAttrs
|
||||||
}
|
}
|
||||||
|
|
@ -180,7 +180,6 @@ new function(window) {
|
||||||
var currentRoot, currentModule = {view: function() {}}, currentController = {}, now = 0, lastRedraw = 0, lastRedrawId = 0
|
var currentRoot, currentModule = {view: function() {}}, currentController = {}, now = 0, lastRedraw = 0, lastRedrawId = 0
|
||||||
m.module = function(root, module) {
|
m.module = function(root, module) {
|
||||||
m.startComputation()
|
m.startComputation()
|
||||||
cellCache = {}
|
|
||||||
currentRoot = root
|
currentRoot = root
|
||||||
currentModule = module
|
currentModule = module
|
||||||
currentController = new module.controller
|
currentController = new module.controller
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue