- commit
- fa7287ed488972712e3ae5e8733422c3ff4977da
- parent
- 5d8686dde9ba909d74df24e507376d10f607935f
- Author
- Tobias Bengfort <tobias.bengfort@gmx.net>
- Date
- 2015-09-11 05:27
move muu- preservation to updateAttributes
Diffstat
| M | src/muu-update-dom.js | 12 | ++++++------ |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/muu-update-dom.js b/src/muu-update-dom.js
@@ -27,6 +27,9 @@ define('muu-update-dom', ['muu-js-helpers'], function(_) {
27 27 "use strict";
28 28
29 29 var updateAttributes = function(target, source) {
-1 30 var muuClasses = _.filter(target.classList, function(cls) {
-1 31 return cls.lastIndexOf('muu-', 0) === 0;
-1 32 });
30 33 var targetAttrNames = _.map(target.attributes, function(item) {
31 34 return item.name;
32 35 });
@@ -45,6 +48,9 @@ define('muu-update-dom', ['muu-js-helpers'], function(_) {
45 48 target.setAttribute(name, source.getAttribute(name));
46 49 }
47 50 });
-1 51 _.forEach(muuClasses, function(cls) {
-1 52 target.classList.add(cls);
-1 53 });
48 54 };
49 55
50 56 var updateDOM = function(target, source) {
@@ -64,13 +70,7 @@ define('muu-update-dom', ['muu-js-helpers'], function(_) {
64 70
65 71 if (tchild.nodeType === schild.nodeType && tchild.nodeName === schild.nodeName && tchild.type === schild.type) {
66 72 if (tchild.nodeType === 1) {
67 -1 var muuClasses = _.filter(tchild.classList, function(cls) {
68 -1 return cls.lastIndexOf('muu-', 0) === 0;
69 -1 });
70 73 updateAttributes(tchild, schild);
71 -1 _.forEach(muuClasses, function(cls) {
72 -1 tchild.classList.add(cls);
73 -1 });
74 74 } else if (tchild.nodeType === 3) {
75 75 tchild.nodeValue = schild.nodeValue;
76 76 }