Merge pull request #1226 from yaruson/issue-1195
IE8 compatibility fixes
This commit is contained in:
commit
f213db37b2
1 changed files with 12 additions and 7 deletions
19
mithril.js
19
mithril.js
|
|
@ -100,7 +100,7 @@
|
||||||
cell.attrs.id = match[2]
|
cell.attrs.id = match[2]
|
||||||
} else if (match[1] === ".") {
|
} else if (match[1] === ".") {
|
||||||
classes.push(match[2])
|
classes.push(match[2])
|
||||||
} else if (match[3][0] === "[") {
|
} else if (match[3].charAt(0) === "[") { // #1195
|
||||||
var attrValue = match[6]
|
var attrValue = match[6]
|
||||||
if (attrValue) attrValue = attrValue.replace(/\\(["'])/g, "$1")
|
if (attrValue) attrValue = attrValue.replace(/\\(["'])/g, "$1")
|
||||||
cell.attrs[match[4]] = attrValue || true
|
cell.attrs[match[4]] = attrValue || true
|
||||||
|
|
@ -1081,14 +1081,19 @@
|
||||||
//
|
//
|
||||||
// #348 don't set the value if not needed - otherwise, cursor
|
// #348 don't set the value if not needed - otherwise, cursor
|
||||||
// placement breaks in Chrome
|
// placement breaks in Chrome
|
||||||
try {
|
// #1195 do not update attribute value if not changed
|
||||||
if (tag !== "input" || node[attrName] !== dataAttr) {
|
if (node[attrName] !== dataAttr) {
|
||||||
node[attrName] = dataAttr
|
try {
|
||||||
|
if (tag !== "input" || node[attrName] !== dataAttr) {
|
||||||
|
node[attrName] = dataAttr
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
node.setAttribute(attrName, dataAttr)
|
||||||
}
|
}
|
||||||
} catch (e) {
|
|
||||||
node.setAttribute(attrName, dataAttr)
|
|
||||||
}
|
}
|
||||||
} else node.setAttribute(attrName, dataAttr)
|
} else if (node[attrName] !== dataAttr) {
|
||||||
|
node.setAttribute(attrName, dataAttr)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function trySetAttr(
|
function trySetAttr(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue