Skip to content

Commit

Permalink
Merge pull request knockout#844 from knockout/844-ie8-popup-window-bi…
Browse files Browse the repository at this point in the history
…ndings

IE7/8 issue with knockout 'text' binding in popup window
  • Loading branch information
SteveSanderson committed Dec 11, 2013
2 parents 2d6cf41 + e608554 commit c12c5ad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/binding/defaultBindings/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ ko.bindingHandlers['options'] = {
previousSelectedValues = oldOptions[0].selected ? [ ko.selectExtensions.readValue(oldOptions[0]) ] : [];
itemUpdate = true;
}
var option = document.createElement("option");
var option = element.ownerDocument.createElement("option");
if (arrayEntry === captionPlaceholder) {
ko.utils.setTextContent(option, allBindings.get('optionsCaption'));
ko.selectExtensions.writeValue(option, undefined);
Expand Down
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ ko.utils = (function () {
// we'll clear everything and create a single text node.
var innerTextNode = ko.virtualElements.firstChild(element);
if (!innerTextNode || innerTextNode.nodeType != 3 || ko.virtualElements.nextSibling(innerTextNode)) {
ko.virtualElements.setDomNodeChildren(element, [document.createTextNode(value)]);
ko.virtualElements.setDomNodeChildren(element, [element.ownerDocument.createTextNode(value)]);
} else {
innerTextNode.data = value;
}
Expand Down

0 comments on commit c12c5ad

Please sign in to comment.