Skip to content

Commit

Permalink
fix safari bug, try ... catch ... - MithrilJS/mithril.js#917
Browse files Browse the repository at this point in the history
  • Loading branch information
cheft committed Jan 8, 2016
1 parent 4649c17 commit 581b8b3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
mithril-starter-kit
===================

modify your local IP in app/config.js

npm install

npm start
Expand Down
2 changes: 1 addition & 1 deletion app/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
dbPrefix: 'http://172.16.0.135:3000/api/'
dbPrefix: typeof window == 'undefined' ? 'http://127.0.0.1:3000/api/' : '/api/'
// :TODO
// apiPrefix: 'http://shanghai.qfang.com/brokerweb/',
};
15 changes: 10 additions & 5 deletions public/assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -713,10 +713,15 @@
else nextSibling.insertAdjacentHTML("beforebegin", data);
}
else {
if (window.Range && window.Range.prototype.createContextualFragment) {
parentElement.appendChild($document.createRange().createContextualFragment(data));
}
else parentElement.insertAdjacentHTML("beforeend", data);
// if (window.Range && window.Range.prototype.createContextualFragment) {
// parentElement.appendChild($document.createRange().createContextualFragment(data));
// }
// else parentElement.insertAdjacentHTML("beforeend", data);
try {
parentElement.appendChild($document.createRange().createContextualFragment(data))
} catch (e) {
parentElement.insertAdjacentHTML("beforeend", data)
}
}
var nodes = [];
while (parentElement.childNodes[index] !== nextSibling) {
Expand Down Expand Up @@ -3457,7 +3462,7 @@
/***/ function(module, exports) {

module.exports = {
dbPrefix: 'http://172.16.0.135:3000/api/'
dbPrefix: typeof window == 'undefined' ? 'http://127.0.0.1:3000/api/' : '/api/'
// :TODO
// apiPrefix: 'http://shanghai.qfang.com/brokerweb/',
};
Expand Down

0 comments on commit 581b8b3

Please sign in to comment.