Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Merge pull request #8157 from SAPlayer/live-preview-css-doc
Browse files Browse the repository at this point in the history
Fix live highlight when starting from a CSSDocument
  • Loading branch information
redmunds committed Jun 26, 2014
2 parents f5fd5fa + 0f1d76d commit 790b3f2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/LiveDevelopment/LiveDevelopment.js
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,9 @@ define(function LiveDevelopment(require, exports, module) {
docPromise.done(function (doc) {
if ((_classForDocument(doc) === CSSDocument) &&
(!_liveDocument || (doc !== _liveDocument.doc))) {
var liveDoc = _createDocument(doc);
// The doc may already have an editor (e.g. starting live preview from an css file),
// so pass the editor if any
var liveDoc = _createDocument(doc, doc._masterEditor);
if (liveDoc) {
_server.add(liveDoc);
_relatedDocuments[doc.url] = liveDoc;
Expand Down Expand Up @@ -1467,4 +1469,4 @@ define(function LiveDevelopment(require, exports, module) {
exports.init = init;
exports.getCurrentProjectServerConfig = getCurrentProjectServerConfig;
exports.getServerBaseUrl = getServerBaseUrl;
});
});

0 comments on commit 790b3f2

Please sign in to comment.